mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +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:
parent
2a9c4b4901
commit
1aa3e09c20
9 changed files with 137 additions and 62 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue