1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #27717 -- Allowed migration optimization across AlterModelOptions.

This commit is contained in:
Ed Morley
2017-01-10 23:38:48 +00:00
committed by Tim Graham
parent 6872ce2266
commit 7156a6c9c4
2 changed files with 23 additions and 0 deletions

View File

@@ -101,6 +101,17 @@ class OptimizerTests(SimpleTestCase):
],
)
def test_create_alter_model_options(self):
self.assertOptimizesTo(
[
migrations.CreateModel('Foo', fields=[]),
migrations.AlterModelOptions(name='Foo', options={'verbose_name_plural': 'Foozes'}),
],
[
migrations.CreateModel('Foo', fields=[], options={'verbose_name_plural': 'Foozes'}),
]
)
def _test_create_alter_foo_delete_model(self, alter_foo):
"""
CreateModel, AlterModelTable, AlterUniqueTogether/AlterIndexTogether/