MCPcopy
hub / github.com/django/django / test_remove_field

Method test_remove_field

tests/migrations/test_state.py:1520–1534  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1518 )
1519
1520 def test_remove_field(self):
1521 project_state = self.get_base_project_state()
1522 self.assertEqual(
1523 list(project_state.relations["tests", "user"]),
1524 [("tests", "comment"), ("tests", "post")],
1525 )
1526 # Remove a many-to-many field.
1527 project_state.remove_field("tests", "post", "authors")
1528 self.assertEqual(
1529 list(project_state.relations["tests", "user"]),
1530 [("tests", "comment")],
1531 )
1532 # Remove a foreign key.
1533 project_state.remove_field("tests", "comment", "user")
1534 self.assertEqual(project_state.relations["tests", "user"], {})
1535
1536 def test_remove_field_no_relations(self):
1537 project_state = self.get_base_project_state()

Callers

nothing calls this directly

Calls 2

remove_fieldMethod · 0.45

Tested by

no test coverage detected