1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #23071 -- Use last migration's name in dependency to other app

Changed the autodetector to lookup the name of the other app's last
migration in the graph and use that as dependency instead of using
__latest__.
This commit is contained in:
Jeroen Dekkers
2014-07-14 21:09:33 +02:00
parent b4cf7e3d1d
commit 3582698c13
9 changed files with 9 additions and 65 deletions

View File

@@ -122,26 +122,6 @@ class LoaderTests(TestCase):
],
)
@modify_settings(INSTALLED_APPS={'append': 'basic'})
@override_settings(MIGRATION_MODULES={
"migrations": "migrations.test_migrations_latest",
"basic": "migrations.test_migrations_latest_basic",
})
def test_latest(self):
"""
Makes sure that __latest__ works correctly.
"""
# Load and test the plan
migration_loader = MigrationLoader(connection)
self.assertEqual(
migration_loader.graph.forwards_plan(("migrations", "0001_initial")),
[
("basic", "0001_initial"),
("basic", "0002_second"),
("migrations", "0001_initial"),
],
)
@override_settings(MIGRATION_MODULES={
"migrations": "migrations.test_migrations_first",
"migrations2": "migrations2.test_migrations_2_first",