summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-30 16:03:06 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-30 22:11:17 +0100
commit7ed20e015335076fc98ad805eaf241f8a0d872d5 (patch)
tree2ef3dda77256843bb42dd1f192b0b65ee814d9b6 /tests
parentc31d7c48139260ccb72deda9b0033db0db86e84a (diff)
Populated Apps instances immediately by default.
Diffstat (limited to 'tests')
-rw-r--r--tests/apps/models.py2
-rw-r--r--tests/apps/tests.py17
-rw-r--r--tests/migrations/test_state.py6
3 files changed, 8 insertions, 17 deletions
diff --git a/tests/apps/models.py b/tests/apps/models.py
index a7a9b691c3..d6907eced1 100644
--- a/tests/apps/models.py
+++ b/tests/apps/models.py
@@ -6,7 +6,7 @@ from django.db import models
# We're testing app registry presence on load, so this is handy.
-new_apps = Apps()
+new_apps = Apps(['apps'])
class TotallyNormal(models.Model):
diff --git a/tests/apps/tests.py b/tests/apps/tests.py
index a75ae94a75..326ddcb6ab 100644
--- a/tests/apps/tests.py
+++ b/tests/apps/tests.py
@@ -36,7 +36,7 @@ class AppsTests(TestCase):
Ensures that only one master registry can exist.
"""
with self.assertRaises(RuntimeError):
- Apps(master=True)
+ Apps(installed_apps=None)
def test_ready(self):
"""
@@ -44,17 +44,8 @@ class AppsTests(TestCase):
"""
# The master app registry is always ready when the tests run.
self.assertTrue(apps.ready)
-
- def test_non_master_ready(self):
- """
- Tests the ready property of a registry other than the master.
- """
- apps = Apps()
- self.assertFalse(apps.ready)
- apps.populate_apps([])
- self.assertFalse(apps.ready)
- apps.populate_models()
- self.assertTrue(apps.ready)
+ # Non-master app registries are populated in __init__.
+ self.assertTrue(Apps().ready)
def test_bad_app_config(self):
"""
@@ -162,7 +153,7 @@ class AppsTests(TestCase):
old_models = list(apps.get_app_config("apps").get_models())
# Construct a new model in a new app registry
body = {}
- new_apps = Apps()
+ new_apps = Apps(["apps"])
meta_contents = {
'app_label': "apps",
'apps': new_apps,
diff --git a/tests/migrations/test_state.py b/tests/migrations/test_state.py
index b7af48fede..e2d970e0f5 100644
--- a/tests/migrations/test_state.py
+++ b/tests/migrations/test_state.py
@@ -14,7 +14,7 @@ class StateTests(TestCase):
Tests making a ProjectState from an Apps
"""
- new_apps = Apps()
+ new_apps = Apps(["migrations"])
class Author(models.Model):
name = models.CharField(max_length=255)
@@ -108,7 +108,7 @@ class StateTests(TestCase):
apps = Apps()
# First, test rendering individually
- apps = Apps()
+ apps = Apps(["migrations"])
# We shouldn't be able to render yet
ms = ModelState.from_model(Novel)
@@ -135,7 +135,7 @@ class StateTests(TestCase):
app_label = "migrations"
apps = Apps()
- apps = Apps()
+ apps = Apps(["migrations"])
# We shouldn't be able to render yet
ms = ModelState.from_model(FooBar)