mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #6170 -- Ensured that a useful exception is raised when a regex is invalid in the URLConf.
Thanks to abrahamson.j for the report, to guettli for initial work on the patch, and to David Gouldin for the new patch and test.
This commit is contained in:
@@ -511,3 +511,11 @@ class ErroneousViewTests(TestCase):
|
||||
self.assertRaises(ViewDoesNotExist, self.client.get, '/missing_outer/')
|
||||
self.assertRaises(ViewDoesNotExist, self.client.get, '/uncallable/')
|
||||
|
||||
def test_erroneous_reverse(self):
|
||||
"""
|
||||
Ensure that a useful exception is raised when a regex is invalid in the
|
||||
URLConf.
|
||||
Refs #6170.
|
||||
"""
|
||||
# The regex error will be hit before NoReverseMatch can be raised
|
||||
self.assertRaises(ImproperlyConfigured, reverse, 'whatever blah blah')
|
||||
|
||||
Reference in New Issue
Block a user