summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-26 15:04:58 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-26 15:04:58 +0100
commit52325b0a04cf1fcf444cece197585a35cf65bab9 (patch)
treea8c8637d54d056eff76b70a11412e4fc6030c5d9 /tests
parent922430177ccdaed2561ec442a76de3eb89ae88a0 (diff)
Turned apps.ready into a property. Added tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/apps/tests.py30
1 files changed, 23 insertions, 7 deletions
diff --git a/tests/apps/tests.py b/tests/apps/tests.py
index c38d16f8bb..a14199d41c 100644
--- a/tests/apps/tests.py
+++ b/tests/apps/tests.py
@@ -10,6 +10,29 @@ from .models import TotallyNormal, SoAlternative, new_apps
class AppsTests(TestCase):
+ def test_singleton_master(self):
+ """
+ Ensures that only one master registry can exist.
+ """
+ with self.assertRaises(RuntimeError):
+ Apps(master=True)
+
+ def test_ready(self):
+ """
+ Tests the ready property of the master registry.
+ """
+ # 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()
+ # Currently, non-master app registries are artificially considered
+ # ready regardless of whether populate_models() has run.
+ self.assertTrue(apps.ready)
+
def test_models_py(self):
"""
Tests that the models in the models.py file were loaded correctly.
@@ -42,10 +65,3 @@ class AppsTests(TestCase):
apps.get_models(apps.get_app_config("apps").models_module),
)
self.assertEqual(new_apps.get_model("apps", "SouthPonies"), temp_model)
-
- def test_singleton_master(self):
- """
- Ensures that only one master registry can exist.
- """
- with self.assertRaises(RuntimeError):
- Apps(master=True)