summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-26 19:29:32 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-26 19:29:32 +0100
commitcfbdd587f6964f65fd8b7de049227fa1ead858da (patch)
tree0b1ac351561ad7fc2b349599fd3418ea7a5fd614
parente179291fa58b08c6e52cceb1590666fbcca8f363 (diff)
Added file forgotten in previous commit, plus one more test.
-rw-r--r--tests/apps/apps.py27
-rw-r--r--tests/apps/tests.py6
2 files changed, 32 insertions, 1 deletions
diff --git a/tests/apps/apps.py b/tests/apps/apps.py
new file mode 100644
index 0000000000..2012a34fd4
--- /dev/null
+++ b/tests/apps/apps.py
@@ -0,0 +1,27 @@
+from __future__ import unicode_literals
+
+from django.apps import AppConfig
+
+
+class MyAdmin(AppConfig):
+ name = 'django.contrib.admin'
+ verbose_name = "Admin sweet admin."
+
+
+class MyAuth(AppConfig):
+ name = 'django.contrib.auth'
+ verbose_name = "All your password are belong to us."
+
+
+class BadConfig(AppConfig):
+ """This class doesn't supply the mandatory 'name' attribute."""
+
+
+class NotAConfig(object):
+ name = 'apps'
+
+
+class NoSuchApp(AppConfig):
+ name = 'there is no such app'
+
+
diff --git a/tests/apps/tests.py b/tests/apps/tests.py
index 53afd8e8e9..c743ba04a3 100644
--- a/tests/apps/tests.py
+++ b/tests/apps/tests.py
@@ -73,9 +73,13 @@ class AppsTests(TestCase):
def test_no_such_app(self):
"""
- Tests when INSTALLED_APPS contains an app config for an app that doesn't exist.
+ Tests when INSTALLED_APPS contains an app that doesn't exist, either
+ directly or via an app config.
"""
with self.assertRaises(ImportError):
+ with self.settings(INSTALLED_APPS=['there is no such app']):
+ pass
+ with self.assertRaises(ImportError):
with self.settings(INSTALLED_APPS=['apps.apps.NoSuchApp']):
pass