summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarlton Gibson <carlton.gibson@noumenal.es>2018-03-09 08:57:47 +0100
committerCarlton Gibson <carlton.gibson@noumenal.es>2018-03-09 08:59:57 +0100
commit5b083a824ea90fb1705bd0c208245ff92a5237d8 (patch)
tree4c0be8717afa838f7dfe521e5612f1fcc78984bb /tests
parent4d420a53cf9796ce635d16f6832b6c5f1bb7dc8a (diff)
Fixed #29180 -- Fixed a regression where migrations already in the plan were readded.
Regression in a38ae914d89809aed6d79337b74a8b31b6d3849a.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_loader.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py
index 3d0cc750d2..e0e7e3d258 100644
--- a/tests/migrations/test_loader.py
+++ b/tests/migrations/test_loader.py
@@ -81,6 +81,22 @@ class LoaderTests(TestCase):
# Ensure we've included unmigrated apps in there too
self.assertIn("basic", project_state.real_apps)
+ @override_settings(MIGRATION_MODULES={
+ 'migrations': 'migrations.test_migrations',
+ 'migrations2': 'migrations2.test_migrations_2',
+ })
+ @modify_settings(INSTALLED_APPS={'append': 'migrations2'})
+ def test_plan_handles_repeated_migrations(self):
+ """
+ _generate_plan() doesn't readd migrations already in the plan (#29180).
+ """
+ migration_loader = MigrationLoader(connection)
+ nodes = [('migrations', '0002_second'), ('migrations2', '0001_initial')]
+ self.assertEqual(
+ migration_loader.graph._generate_plan(nodes, at_end=True),
+ [('migrations', '0001_initial'), ('migrations', '0002_second'), ('migrations2', '0001_initial')]
+ )
+
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_unmigdep"})
def test_load_unmigrated_dependency(self):
"""