Ticket #27717: 0001-Refs-27717-Added-a-regression-test.patch

File 0001-Refs-27717-Added-a-regression-test.patch, 1.3 KB (added by Simon Charette, 8 years ago)
  • tests/migrations/test_optimizer.py

    From 29be7d6f01b8c336b189a345fdd6ffafb4f35a81 Mon Sep 17 00:00:00 2001
    From: Simon Charette <charette.s@gmail.com>
    Date: Tue, 10 Jan 2017 14:45:35 -0500
    Subject: [PATCH] Refs #27717 -- Added a regression test.
    
    ---
     tests/migrations/test_optimizer.py | 11 +++++++++++
     1 file changed, 11 insertions(+)
    
    diff --git a/tests/migrations/test_optimizer.py b/tests/migrations/test_optimizer.py
    index 4893bf0..9edf2df 100644
    a b class OptimizerTests(SimpleTestCase):  
    125125    def test_create_alter_owrt_delete_model(self):
    126126        self._test_create_alter_foo_delete_model(migrations.AlterOrderWithRespectTo("Foo", "a"))
    127127
     128    def test_create_alter_model_options(self):
     129        self.assertOptimizesTo(
     130            [
     131                migrations.CreateModel('Foo', fields=[]),
     132                migrations.AlterModelOptions(name='Foo', options={'verbose_name_plural': 'Foozes'}),
     133            ],
     134            [
     135                migrations.CreateModel('Foo', fields=[], options={'verbose_name_plural': 'Foozes'}),
     136            ]
     137        )
     138
    128139    def _test_alter_alter_model(self, alter_foo, alter_bar):
    129140        """
    130141        Two AlterUniqueTogether/AlterIndexTogether/AlterOrderWithRespectTo
Back to Top