Ticket #25540: 25540-init.diff

File 25540-init.diff, 2.7 KB (added by Tim Graham, 8 years ago)
  • tests/migrations/test_executor.py

    diff --git a/tests/migrations/test_executor.py b/tests/migrations/test_executor.py
    index 01b31a6..71c158a 100644
    a b class ExecutorTests(MigrationTestBase):  
    126126        migrations_apps = executor.loader.project_state(("migrations", "0001_initial")).apps
    127127        Editor = migrations_apps.get_model("migrations", "Editor")
    128128        self.assertFalse(Editor.objects.exists())
     129        executor.migrate([("migrations", None)])
    129130
    130131    @override_settings(MIGRATION_MODULES={
    131132        "migrations": "migrations.test_migrations",
    class ExecutorTests(MigrationTestBase):  
    512513            ('mutate_state_a', None),
    513514        ])
    514515        self.assertIn('added', dict(state.models['mutate_state_b', 'b'].fields))
     516        state = executor.migrate([
     517            ('mutate_state_b', None),
     518        ])
    515519
    516520    @override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"})
    517521    def test_process_callback(self):
    class ExecutorTests(MigrationTestBase):  
    590594            with connection.schema_editor() as editor:
    591595                editor.execute(editor.sql_delete_table % {"table": "book_app_book"})
    592596                editor.execute(editor.sql_delete_table % {"table": "author_app_author"})
     597            MigrationRecorder(connection).migration_qs.filter(
     598                app__in=('author_app', 'book_app'),
     599            ).delete()
    593600            self.assertTableNotExists("author_app_author")
    594601            self.assertTableNotExists("book_app_book")
    595602
  • tests/migrations/test_loader.py

    diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py
    index b464209..c81a38a 100644
    a b class LoaderTests(TestCase):  
    399399        )
    400400        with self.assertRaisesMessage(InconsistentMigrationHistory, msg):
    401401            loader.check_consistent_history(connection)
     402        recorder.record_unapplied('migrations', '0002_second')
    402403
    403404    @override_settings(
    404405        MIGRATION_MODULES={'migrations': 'migrations.test_migrations_squashed_extra'},
  • tests/migrations/test_migrations_atomic_operation/0001_initial.py

    diff --git a/tests/migrations/test_migrations_atomic_operation/0001_initial.py b/tests/migrations/test_migrations_atomic_operation/0001_initial.py
    index 11bd2f7..495150f 100644
    a b class Migration(migrations.Migration):  
    2121                ("name", models.CharField(primary_key=True, max_length=255)),
    2222            ],
    2323        ),
    24         migrations.RunPython(raise_error, atomic=True),
     24        migrations.RunPython(raise_error, reverse_code=migrations.RunPython.noop, atomic=True),
    2525    ]
Back to Top