diff options
| author | Jacob Walls <jacobtylerwalls@gmail.com> | 2021-06-05 01:06:17 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-08-30 12:08:04 +0200 |
| commit | 3219dd3388c437b4bd869b76ddd43c9cdad05090 (patch) | |
| tree | 53db28fd03110483db1b5f7862e0233d12ee8ebb /tests/migrations/test_commands.py | |
| parent | 9e17cc062c62eec1177aaf65ebebba43e074cde2 (diff) | |
Fixed #24900 -- Allowed migrating backward to squashed migrations.
Diffstat (limited to 'tests/migrations/test_commands.py')
| -rw-r--r-- | tests/migrations/test_commands.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py index 563b1bd146..d545f125dd 100644 --- a/tests/migrations/test_commands.py +++ b/tests/migrations/test_commands.py @@ -980,6 +980,19 @@ class MigrateTests(MigrationTestBase): # Unmigrate everything. call_command('migrate', 'migrations', 'zero', verbosity=0) + @override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations_squashed'}) + def test_migrate_backward_to_squashed_migration(self): + try: + call_command('migrate', 'migrations', '0001_squashed_0002', verbosity=0) + self.assertTableExists('migrations_author') + self.assertTableExists('migrations_book') + call_command('migrate', 'migrations', '0001_initial', verbosity=0) + self.assertTableExists('migrations_author') + self.assertTableNotExists('migrations_book') + finally: + # Unmigrate everything. + call_command('migrate', 'migrations', 'zero', verbosity=0) + @override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations'}) def test_migrate_inconsistent_history(self): """ |
