summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2015-06-01 17:22:10 -0600
committerCarl Meyer <carl@oddbird.net>2015-06-02 12:07:54 -0600
commit84522c0d165076d01cd034d7c381b75044daec8d (patch)
tree8d0526b535f25f63cabb5dcbf8058dcc93145ec3 /tests
parent262d4db8c4c849b0fdd84550fb96472446cf90df (diff)
Fixed #24895 -- Fixed loading a pair of squashed migrations with a dependency.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_loader.py29
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py
index 5c268aa33b..07794e6a06 100644
--- a/tests/migrations/test_loader.py
+++ b/tests/migrations/test_loader.py
@@ -259,12 +259,37 @@ class LoaderTests(TestCase):
loader.build_graph()
plan = set(loader.graph.forwards_plan(('app1', '4_auto')))
- expected_plan = set([
+ expected_plan = {
('app1', '4_auto'),
('app1', '2_squashed_3'),
('app2', '1_squashed_2'),
('app1', '1_auto')
- ])
+ }
+ self.assertEqual(plan, expected_plan)
+
+ @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_partially_applied(self):
+ loader = MigrationLoader(connection)
+ recorder = MigrationRecorder(connection)
+ recorder.record_applied('app1', '1_auto')
+ recorder.record_applied('app1', '2_auto')
+ loader.build_graph()
+
+ plan = set(loader.graph.forwards_plan(('app1', '4_auto')))
+ plan = plan - loader.applied_migrations
+ expected_plan = {
+ ('app1', '4_auto'),
+ ('app1', '3_auto'),
+ ('app2', '1_squashed_2'),
+ }
+
self.assertEqual(plan, expected_plan)
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_squashed_erroneous"})