Skip to content

Commit

Permalink
Removed an obsolete unicity check.
Browse files Browse the repository at this point in the history
It doesn't account for app configs.

Refs #21679.
  • Loading branch information
aaugustin committed Dec 31, 2013
1 parent d0eeddd commit 5535001
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
5 changes: 0 additions & 5 deletions django/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ def __setattr__(self, name, value):
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)


Expand Down
21 changes: 0 additions & 21 deletions tests/settings_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,27 +292,6 @@ def test_complex_override_warning(self):
'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.
Expand Down

0 comments on commit 5535001

Please sign in to comment.