From 886bb9d8780303b4c8f45c55e0ac0a6b644b73af Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 14 Sep 2013 07:19:32 -0400 Subject: [PATCH] Revert "Fixed #12288 -- Validated that app names in INSTALLED_APPS are unique" This reverts commit c1ec08998d1b690855d5e69a1f4d9d2f01d44ae6. There are backwards compatability concerns with this. --- django/conf/__init__.py | 5 ++--- tests/settings_tests/tests.py | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/django/conf/__init__.py b/django/conf/__init__.py index 6266ca2394..199c34fb55 100644 --- a/django/conf/__init__.py +++ b/django/conf/__init__.py @@ -109,9 +109,8 @@ class BaseSettings(object): "to a tuple, not a string.") elif name == "INSTALLED_APPS": value = list(value) # force evaluation of generators on Python 3 - apps = [s.split('.')[-1] for s in value] - if len(value) != len(set(apps)): - raise ImproperlyConfigured("The INSTALLED_APPS setting must contain unique app names.") + if len(value) != len(set(value)): + raise ImproperlyConfigured("The INSTALLED_APPS setting must contain unique values.") object.__setattr__(self, name, value) diff --git a/tests/settings_tests/tests.py b/tests/settings_tests/tests.py index 0ffb56bb82..a9503358a2 100644 --- a/tests/settings_tests/tests.py +++ b/tests/settings_tests/tests.py @@ -241,14 +241,11 @@ class UniqueSettingsTests(TestCase): def test_unique(self): """ An ImproperlyConfigured exception is raised if the INSTALLED_APPS contains - any duplicate appication names. + any duplicate strings. """ with self.assertRaises(ImproperlyConfigured): self.settings_module.INSTALLED_APPS = ("myApp1", "myApp1", "myApp2", "myApp3") - with self.assertRaises(ImproperlyConfigured): - self.settings_module.INSTALLED_APPS = ("package1.myApp1", "package2.myApp1") - class TrailingSlashURLTests(TestCase): """