From 553500133cc4426f20407391f3493716357db45f Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Tue, 31 Dec 2013 16:22:07 +0100 Subject: [PATCH] Removed an obsolete unicity check. It doesn't account for app configs. Refs #21679. --- django/conf/__init__.py | 5 ----- tests/settings_tests/tests.py | 21 --------------------- 2 files changed, 26 deletions(-) diff --git a/django/conf/__init__.py b/django/conf/__init__.py index ac074d5166..3449368cb0 100644 --- a/django/conf/__init__.py +++ b/django/conf/__init__.py @@ -104,11 +104,6 @@ class BaseSettings(object): elif name == "ALLOWED_INCLUDE_ROOTS" and isinstance(value, six.string_types): raise ValueError("The ALLOWED_INCLUDE_ROOTS setting must be set " "to a tuple, not a string.") - elif name == "INSTALLED_APPS": - value = list(value) # force evaluation of generators on Python 3 - 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 2225862f7f..9b2f5c79fa 100644 --- a/tests/settings_tests/tests.py +++ b/tests/settings_tests/tests.py @@ -292,27 +292,6 @@ class TestComplexSettingOverride(TestCase): 'Overriding setting TEST_WARN can lead to unexpected behaviour.') -class UniqueSettingsTests(TestCase): - """ - Tests for the INSTALLED_APPS setting. - """ - settings_module = settings - - def setUp(self): - self._installed_apps = self.settings_module.INSTALLED_APPS - - def tearDown(self): - self.settings_module.INSTALLED_APPS = self._installed_apps - - def test_unique(self): - """ - An ImproperlyConfigured exception is raised if the INSTALLED_APPS contains - any duplicate strings. - """ - with self.assertRaises(ImproperlyConfigured): - self.settings_module.INSTALLED_APPS = ("myApp1", "myApp1", "myApp2", "myApp3") - - class TrailingSlashURLTests(TestCase): """ Tests for the MEDIA_URL and STATIC_URL settings.