mirror of https://github.com/django/django.git
[1.7.x] Cleanup failing test w/contenttypes and remove useless graph load
This commit is contained in:
parent
c0d5521e69
commit
6ca5367869
|
@ -53,8 +53,7 @@ class Command(BaseCommand):
|
||||||
# Load the current graph state. Takes a connection, but it's not used
|
# Load the current graph state. Takes a connection, but it's not used
|
||||||
# (makemigrations doesn't look at the database state).
|
# (makemigrations doesn't look at the database state).
|
||||||
# Also make sure the graph is built without unmigrated apps shoehorned in.
|
# Also make sure the graph is built without unmigrated apps shoehorned in.
|
||||||
loader = MigrationLoader(connections[DEFAULT_DB_ALIAS], load=False)
|
loader = MigrationLoader(connections[DEFAULT_DB_ALIAS])
|
||||||
loader.build_graph()
|
|
||||||
|
|
||||||
# Before anything else, see if there's conflicting apps and drop out
|
# Before anything else, see if there's conflicting apps and drop out
|
||||||
# hard if there are any and they don't want to merge
|
# hard if there are any and they don't want to merge
|
||||||
|
|
|
@ -361,7 +361,10 @@ class StateTests(TestCase):
|
||||||
project_state = ProjectState(real_apps=["contenttypes"])
|
project_state = ProjectState(real_apps=["contenttypes"])
|
||||||
project_state.add_model_state(ModelState.from_model(TestModel))
|
project_state.add_model_state(ModelState.from_model(TestModel))
|
||||||
rendered_state = project_state.render()
|
rendered_state = project_state.render()
|
||||||
self.assertEqual(len(rendered_state.get_models()), 2)
|
self.assertEqual(
|
||||||
|
len([x for x in rendered_state.get_models() if x._meta.app_label == "migrations"]),
|
||||||
|
1,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ModelStateTests(TestCase):
|
class ModelStateTests(TestCase):
|
||||||
|
|
Loading…
Reference in New Issue