mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #23745 -- Reused states as much as possible in migrations
Thanks Tim Graham and Markus Holtermann for the reviews.
This commit is contained in:
@@ -828,12 +828,13 @@ class OperationTests(OperationTestBase):
|
||||
])
|
||||
self.assertTableExists("test_rmflmm_pony_stables")
|
||||
|
||||
with_field_state = project_state.clone()
|
||||
operations = [migrations.RemoveField("Pony", "stables")]
|
||||
self.apply_operations("test_rmflmm", project_state, operations=operations)
|
||||
project_state = self.apply_operations("test_rmflmm", project_state, operations=operations)
|
||||
self.assertTableNotExists("test_rmflmm_pony_stables")
|
||||
|
||||
# And test reversal
|
||||
self.unapply_operations("test_rmflmm", project_state, operations=operations)
|
||||
self.unapply_operations("test_rmflmm", with_field_state, operations=operations)
|
||||
self.assertTableExists("test_rmflmm_pony_stables")
|
||||
|
||||
def test_remove_field_m2m_with_through(self):
|
||||
|
||||
Reference in New Issue
Block a user