mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fix __latest__ to actually resolve to the latest migration
This commit is contained in:
@@ -122,6 +122,26 @@ 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"})
|
||||
def test_name_match(self):
|
||||
"Tests prefix name matching"
|
||||
|
||||
Reference in New Issue
Block a user