Ticket #22788: 22788.diff

File 22788.diff, 1.1 KB (added by Matthew Schinckel, 10 years ago)

Better patch, containing tests.

  • tests/migrations/test_writer.py

    diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py
    index b0d8ba9..4ab0cf7 100644
    a b from django.utils.deconstruct import deconstructible  
    1717from django.utils.translation import ugettext_lazy as _
    1818from django.utils.timezone import get_default_timezone
    1919
     20import operations
    2021
    2122class TestModel1(object):
    2223    def upload_to(self):
    class WriterTests(TestCase):  
    252253                TestOperation(),
    253254                CreateModel(),
    254255                migrations.CreateModel("MyModel", (), {}, (models.Model,)),
     256                operations.TestOperation()
    255257            ],
    256258            "dependencies": []
    257259        })
    258260        writer = MigrationWriter(migration)
    259261        output = writer.as_string()
    260262        result = self.safe_exec(output)
     263        # Need a way to ensure we have two different
     264        # TestOperation classes.
    261265        self.assertIn("TestOperation", result)
    262         self.assertIn("CreateModel", result)
    263  No newline at end of file
     266        self.assertIn("CreateModel", result)
Back to Top