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-13 17:23:58 -0400
commit5e4920c14b2706178474ebbf335eda870dbc8ee8 (patch)
tree97df1a2c724a298385d666c23d82e4d61986f8b7 /tests/check_framework/tests_1_10_compatibility.py
parent92c069ad334cbe2ff20b27c4dd9920d230a4916b (diff)
downloaddjango-5e4920c14b2706178474ebbf335eda870dbc8ee8.tar.gz
Refs #26601 -- Added a warning if both MIDDLEWARE AND MIDDLEWARE_CLASSES are set.dep5
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)