From c40209dcc09f19524fb85251f39a4051491bbec0 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Tue, 31 Dec 2013 16:23:42 +0100 Subject: Made it possible to change an application's label in its configuration. Fixed #21683. --- tests/apps/apps.py | 5 +++++ tests/apps/tests.py | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'tests/apps') 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. -- cgit v1.3