diff options
| author | Jacob Walls <jacobtylerwalls@gmail.com> | 2021-06-08 00:59:04 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-06-08 08:40:34 +0200 |
| commit | c0e29cec83d000cc0b1087214e4658074fa0499c (patch) | |
| tree | e552b5c513f828fe78d97230510514e3cb375f30 /tests | |
| parent | 8c3bd0b708b488a1f6e8bd8cc6b96569904605be (diff) | |
Fixed #25255 -- Recorded unapplied squashed migrations.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_executor.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/migrations/test_executor.py b/tests/migrations/test_executor.py index e61d8f1276..fc80c950fa 100644 --- a/tests/migrations/test_executor.py +++ b/tests/migrations/test_executor.py @@ -653,6 +653,23 @@ class ExecutorTests(MigrationTestBase): recorder.applied_migrations(), ) + @override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations_squashed'}) + def test_migrate_marks_replacement_unapplied(self): + executor = MigrationExecutor(connection) + executor.migrate([('migrations', '0001_squashed_0002')]) + try: + self.assertIn( + ('migrations', '0001_squashed_0002'), + executor.recorder.applied_migrations(), + ) + finally: + executor.loader.build_graph() + executor.migrate([('migrations', None)]) + self.assertNotIn( + ('migrations', '0001_squashed_0002'), + executor.recorder.applied_migrations(), + ) + # When the feature is False, the operation and the record won't be # performed in a transaction and the test will systematically pass. @skipUnlessDBFeature('can_rollback_ddl') |
