summaryrefslogtreecommitdiff
path: root/tests/check_framework/tests_1_10_compatibility.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-05-09 19:58:47 -0400
committerTim Graham <timograham@gmail.com>2016-05-17 07:24:45 -0400
commit354acd04af524ad82002b903df1189581c51cabe (patch)
tree52c4fe0a18f436f2280149e66dd8efa7cb508ae0 /tests/check_framework/tests_1_10_compatibility.py
parentece4d24f8e494129c098868fa792400937941fab (diff)
Refs #26601 -- Added a warning if both MIDDLEWARE AND MIDDLEWARE_CLASSES are set.
Diffstat (limited to 'tests/check_framework/tests_1_10_compatibility.py')
-rw-r--r--tests/check_framework/tests_1_10_compatibility.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/check_framework/tests_1_10_compatibility.py b/tests/check_framework/tests_1_10_compatibility.py
new file mode 100644
index 0000000000..388ac1b024
--- /dev/null
+++ b/tests/check_framework/tests_1_10_compatibility.py
@@ -0,0 +1,17 @@
+from django.core.checks.compatibility.django_1_10 import \
+ check_duplicate_middleware_settings
+from django.test import SimpleTestCase
+from django.test.utils import override_settings
+
+
+class CheckDuplicateMiddlwareSettingsTest(SimpleTestCase):
+
+ @override_settings(MIDDLEWARE=[], MIDDLEWARE_CLASSES=['django.middleware.common.CommonMiddleware'])
+ def test_duplicate_setting(self):
+ result = check_duplicate_middleware_settings(None)
+ self.assertEqual(result[0].id, '1_10.W001')
+
+ @override_settings(MIDDLEWARE=None)
+ def test_middleware_not_defined(self):
+ result = check_duplicate_middleware_settings(None)
+ self.assertEqual(len(result), 0)