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 | |
| parent | 5dfec4e23b4a3b81f8ec19bf0cf45147ad6b18e5 (diff) | |
Made it possible to change an application's label in its configuration.
Fixed #21683.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/apps/apps.py | 5 | ||||
| -rw-r--r-- | tests/apps/tests.py | 4 | ||||
| -rw-r--r-- | tests/proxy_model_inheritance/tests.py | 6 |
3 files changed, 12 insertions, 3 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. diff --git a/tests/proxy_model_inheritance/tests.py b/tests/proxy_model_inheritance/tests.py index 06b47ff82d..5ad5e08c25 100644 --- a/tests/proxy_model_inheritance/tests.py +++ b/tests/proxy_model_inheritance/tests.py @@ -1,4 +1,4 @@ -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals import os import sys @@ -29,8 +29,8 @@ class ProxyModelInheritanceTests(TransactionTestCase): def test_table_exists(self): with self.modify_settings(INSTALLED_APPS={'append': ['app1', 'app2']}): call_command('migrate', verbosity=0) - from .app1.models import ProxyModel - from .app2.models import NiceModel + from app1.models import ProxyModel + from app2.models import NiceModel self.assertEqual(NiceModel.objects.all().count(), 0) self.assertEqual(ProxyModel.objects.all().count(), 0) |
