Fixed #27731 -- Implemented CreateModel/AlterFooOperation reduction.

This should alleviate the side effects of disabling the AlterFooOperation
reduction with RemoveField to fix refs #28862 during migration squashing
because CreateModel can perform a reduction with RemoveField.

Thanks Nick Pope for the review.
This commit is contained in:
Simon Charette 2018-07-14 00:32:09 -04:00 committed by Tim Graham
parent ed7898e1b5
commit 8e3f22f251
4 changed files with 95 additions and 20 deletions

View file

@ -1335,7 +1335,7 @@ class SquashMigrationsTests(MigrationTestBase):
out = io.StringIO()
with self.temporary_migration_module(module="migrations.test_migrations"):
call_command("squashmigrations", "migrations", "0002", interactive=False, verbosity=1, stdout=out)
self.assertIn("Optimized from 8 operations to 4 operations.", out.getvalue())
self.assertIn("Optimized from 8 operations to 2 operations.", out.getvalue())
def test_ticket_23799_squashmigrations_no_optimize(self):
"""