mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #23733 -- Fixed squashing migrations that depend on multiple apps.
This commit is contained in:
@@ -239,6 +239,27 @@ class LoaderTests(TestCase):
|
||||
|
||||
recorder.flush()
|
||||
|
||||
@override_settings(MIGRATION_MODULES={
|
||||
"app1": "migrations.test_migrations_squashed_complex_multi_apps.app1",
|
||||
"app2": "migrations.test_migrations_squashed_complex_multi_apps.app2",
|
||||
})
|
||||
@modify_settings(INSTALLED_APPS={'append': [
|
||||
"migrations.test_migrations_squashed_complex_multi_apps.app1",
|
||||
"migrations.test_migrations_squashed_complex_multi_apps.app2",
|
||||
]})
|
||||
def test_loading_squashed_complex_multi_apps(self):
|
||||
loader = MigrationLoader(connection)
|
||||
loader.build_graph()
|
||||
|
||||
plan = set(loader.graph.forwards_plan(('app1', '4_auto')))
|
||||
expected_plan = set([
|
||||
('app1', '4_auto'),
|
||||
('app1', '2_squashed_3'),
|
||||
('app2', '1_squashed_2'),
|
||||
('app1', '1_auto')
|
||||
])
|
||||
self.assertEqual(plan, expected_plan)
|
||||
|
||||
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_squashed_erroneous"})
|
||||
def test_loading_squashed_erroneous(self):
|
||||
"Tests loading a complex but erroneous set of squashed migrations"
|
||||
|
||||
Reference in New Issue
Block a user