(self)
| 759 | self.assertTableNotExists("test_dlprmo_proxypony") |
| 760 | |
| 761 | def test_delete_mti_model(self): |
| 762 | project_state = self.set_up_test_model("test_dlmtimo", mti_model=True) |
| 763 | # Test the state alteration |
| 764 | operation = migrations.DeleteModel("ShetlandPony") |
| 765 | new_state = project_state.clone() |
| 766 | operation.state_forwards("test_dlmtimo", new_state) |
| 767 | self.assertIn(("test_dlmtimo", "shetlandpony"), project_state.models) |
| 768 | self.assertNotIn(("test_dlmtimo", "shetlandpony"), new_state.models) |
| 769 | # Test the database alteration |
| 770 | self.assertTableExists("test_dlmtimo_pony") |
| 771 | self.assertTableExists("test_dlmtimo_shetlandpony") |
| 772 | self.assertColumnExists("test_dlmtimo_shetlandpony", "pony_ptr_id") |
| 773 | with connection.schema_editor() as editor: |
| 774 | operation.database_forwards( |
| 775 | "test_dlmtimo", editor, project_state, new_state |
| 776 | ) |
| 777 | self.assertTableExists("test_dlmtimo_pony") |
| 778 | self.assertTableNotExists("test_dlmtimo_shetlandpony") |
| 779 | # And test reversal |
| 780 | with connection.schema_editor() as editor: |
| 781 | operation.database_backwards( |
| 782 | "test_dlmtimo", editor, new_state, project_state |
| 783 | ) |
| 784 | self.assertTableExists("test_dlmtimo_pony") |
| 785 | self.assertTableExists("test_dlmtimo_shetlandpony") |
| 786 | self.assertColumnExists("test_dlmtimo_shetlandpony", "pony_ptr_id") |
| 787 | |
| 788 | def test_rename_model(self): |
| 789 | """ |
nothing calls this directly
no test coverage detected