(self)
| 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() |
nothing calls this directly
no test coverage detected