mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #22485: Include all unmigrated apps in project state by default.
This commit is contained in:
parent
24ec9538b7
commit
8f6dff372b
9 changed files with 93 additions and 55 deletions
|
@ -61,7 +61,7 @@ class LoaderTests(TestCase):
|
|||
],
|
||||
)
|
||||
# Now render it out!
|
||||
project_state = migration_loader.graph.project_state(("migrations", "0002_second"))
|
||||
project_state = migration_loader.project_state(("migrations", "0002_second"))
|
||||
self.assertEqual(len(project_state.models), 2)
|
||||
|
||||
author_state = project_state.models["migrations", "author"]
|
||||
|
@ -76,6 +76,9 @@ class LoaderTests(TestCase):
|
|||
["id", "author"]
|
||||
)
|
||||
|
||||
# Ensure we've included unmigrated apps in there too
|
||||
self.assertIn("contenttypes", project_state.real_apps)
|
||||
|
||||
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_unmigdep"})
|
||||
def test_load_unmigrated_dependency(self):
|
||||
"""
|
||||
|
@ -86,12 +89,11 @@ class LoaderTests(TestCase):
|
|||
self.assertEqual(
|
||||
migration_loader.graph.forwards_plan(("migrations", "0001_initial")),
|
||||
[
|
||||
("auth", "__first__"),
|
||||
("migrations", "0001_initial"),
|
||||
],
|
||||
)
|
||||
# Now render it out!
|
||||
project_state = migration_loader.graph.project_state(("migrations", "0001_initial"))
|
||||
project_state = migration_loader.project_state(("migrations", "0001_initial"))
|
||||
self.assertEqual(len([m for a, m in project_state.models if a == "migrations"]), 1)
|
||||
|
||||
book_state = project_state.models["migrations", "book"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue