summaryrefslogtreecommitdiff
path: root/tests/apps
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-01-24 22:43:00 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-01-25 10:41:56 +0100
commit2ff93e027c7b35378cc450a926bc2e4a446cacf0 (patch)
treea6c95d694eadb4bd66b37e9bedad5047d1428d69 /tests/apps
parent29ddae7436e84f4713c7babeabdf9a1fa62d6543 (diff)
Fixed #21829 -- Added default AppConfigs.
Thanks Russell for the report, Marc for the initial patch, Carl for the final review, and everyone who contributed to the design discussion.
Diffstat (limited to 'tests/apps')
-rw-r--r--tests/apps/default_config_app/__init__.py1
-rw-r--r--tests/apps/default_config_app/apps.py5
-rw-r--r--tests/apps/tests.py6
3 files changed, 12 insertions, 0 deletions
diff --git a/tests/apps/default_config_app/__init__.py b/tests/apps/default_config_app/__init__.py
new file mode 100644
index 0000000000..aebe0350d9
--- /dev/null
+++ b/tests/apps/default_config_app/__init__.py
@@ -0,0 +1 @@
+default_app_config = 'apps.default_config_app.apps.CustomConfig'
diff --git a/tests/apps/default_config_app/apps.py b/tests/apps/default_config_app/apps.py
new file mode 100644
index 0000000000..ba859a4750
--- /dev/null
+++ b/tests/apps/default_config_app/apps.py
@@ -0,0 +1,5 @@
+from django.apps import AppConfig
+
+
+class CustomConfig(AppConfig):
+ name = 'apps.default_config_app'
diff --git a/tests/apps/tests.py b/tests/apps/tests.py
index 139bc06a66..814ef0186f 100644
--- a/tests/apps/tests.py
+++ b/tests/apps/tests.py
@@ -7,6 +7,7 @@ from django.db import models
from django.test import TestCase, override_settings
from django.utils import six
+from .default_config_app.apps import CustomConfig
from .models import TotallyNormal, SoAlternative, new_apps
@@ -82,6 +83,11 @@ class AppsTests(TestCase):
with self.settings(INSTALLED_APPS=['apps.apps.NoSuchConfig']):
pass
+ def test_default_app_config(self):
+ with self.settings(INSTALLED_APPS=['apps.default_config_app']):
+ config = apps.get_app_config('default_config_app')
+ self.assertIsInstance(config, CustomConfig)
+
@override_settings(INSTALLED_APPS=SOME_INSTALLED_APPS)
def test_get_app_configs(self):
"""