diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-12-31 16:23:42 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-12-31 17:30:58 +0100 |
| commit | c40209dcc09f19524fb85251f39a4051491bbec0 (patch) | |
| tree | f7788f18e608acf0befab73b3391fea4c21a7066 /tests/apps | |
| parent | 5dfec4e23b4a3b81f8ec19bf0cf45147ad6b18e5 (diff) | |
Made it possible to change an application's label in its configuration.
Fixed #21683.
Diffstat (limited to 'tests/apps')
| -rw-r--r-- | tests/apps/apps.py | 5 | ||||
| -rw-r--r-- | tests/apps/tests.py | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/apps/apps.py b/tests/apps/apps.py index 22c8f3062f..c9d761deb0 100644 --- a/tests/apps/apps.py +++ b/tests/apps/apps.py @@ -23,3 +23,8 @@ class NotAConfig(object): class NoSuchApp(AppConfig): name = 'there is no such app' + + +class RelabeledAppsConfig(AppConfig): + name = 'apps' + label = 'relabeled' diff --git a/tests/apps/tests.py b/tests/apps/tests.py index 2a41acf2e8..495d24dc3e 100644 --- a/tests/apps/tests.py +++ b/tests/apps/tests.py @@ -111,6 +111,10 @@ class AppsTests(TestCase): self.assertTrue(apps.has_app('django.contrib.staticfiles')) self.assertFalse(apps.has_app('django.contrib.webdesign')) + @override_settings(INSTALLED_APPS=['apps.apps.RelabeledAppsConfig']) + def test_relabeling(self): + self.assertEqual(apps.get_app_config('relabeled').name, 'apps') + def test_models_py(self): """ Tests that the models in the models.py file were loaded correctly. |
