Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed test failures on Python 3 - refs #12288

  • Loading branch information...
commit 9c711ee3a6a638add26d19dad70447c981371598 1 parent b575d69
@timgraham timgraham authored
Showing with 5 additions and 3 deletions.
  1. +4 −2 django/conf/__init__.py
  2. +1 −1  tests/settings_tests/tests.py
View
6 django/conf/__init__.py
@@ -107,8 +107,10 @@ 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" and len(value) != len(set(value)):
- raise ImproperlyConfigured("The INSTALLED_APPS setting must contain unique values.")
+ 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)
View
2  tests/settings_tests/tests.py
@@ -226,7 +226,7 @@ def test_complex_override_warning(self):
self.assertEqual('Overriding setting TEST_WARN can lead to unexpected behaviour.', str(w[-1].message))
-class UniqueSettngsTests(TestCase):
+class UniqueSettingsTests(TestCase):
"""
Tests for the INSTALLED_APPS setting.
"""
Please sign in to comment.
Something went wrong with that request. Please try again.