summaryrefslogtreecommitdiff
path: root/tests/urlpatterns_reverse
diff options
context:
space:
mode:
authorAnton Samarchyan <anton.samarchyan@savoirfairelinux.com>2017-01-27 11:47:19 -0500
committerTim Graham <timograham@gmail.com>2017-01-27 13:16:55 -0500
commit0cbfc844a392ae3fd47cc2cf28ba872f19f1d301 (patch)
tree0db4230f35754fa4e670f41eb5539a1ba93afe41 /tests/urlpatterns_reverse
parente07e743e0c375b380748561d18b975c8211a4a01 (diff)
downloaddjango-0cbfc844a392ae3fd47cc2cf28ba872f19f1d301.tar.gz
Improved test coverage and error messages for conf.urls.__init__.
Diffstat (limited to 'tests/urlpatterns_reverse')
-rw-r--r--tests/urlpatterns_reverse/tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/urlpatterns_reverse/tests.py b/tests/urlpatterns_reverse/tests.py
index b2d7e1ad38..8d4cedc2e7 100644
--- a/tests/urlpatterns_reverse/tests.py
+++ b/tests/urlpatterns_reverse/tests.py
@@ -1058,11 +1058,21 @@ class IncludeTests(SimpleTestCase):
with self.assertRaisesMessage(ImproperlyConfigured, msg):
include(self.url_patterns, 'namespace')
+ def test_include_4_tuple(self):
+ msg = 'Passing a 4-tuple to django.conf.urls.include() is not supported.'
+ with self.assertRaisesMessage(ImproperlyConfigured, msg):
+ include((self.url_patterns, 'app_name', 'namespace', 'blah'))
+
def test_include_3_tuple(self):
msg = 'Passing a 3-tuple to django.conf.urls.include() is not supported.'
with self.assertRaisesMessage(ImproperlyConfigured, msg):
include((self.url_patterns, 'app_name', 'namespace'))
+ def test_include_3_tuple_namespace(self):
+ msg = 'Cannot override the namespace for a dynamic module that provides a namespace.'
+ with self.assertRaisesMessage(ImproperlyConfigured, msg):
+ include((self.url_patterns, 'app_name', 'namespace'), 'namespace')
+
def test_include_2_tuple(self):
self.assertEqual(
include((self.url_patterns, 'app_name')),