mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Improved test coverage and error messages for conf.urls.__init__.
This commit is contained in:
committed by
Tim Graham
parent
e07e743e0c
commit
0cbfc844a3
@@ -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')),
|
||||
|
||||
Reference in New Issue
Block a user