mirror of
https://github.com/django/django.git
synced 2025-07-16 01:35:15 +00:00
Fixed #25255 -- Recorded unapplied squashed migrations.
This commit is contained in:
parent
8c3bd0b708
commit
c0e29cec83
2 changed files with 19 additions and 3 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue