mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #21435 -- Improved error message when urlconf is empty.
The new error message now hints that the most likely issue is a circular import. Thanks to trac user elena for the report and to bpeschier for the original patch.
This commit is contained in:
@@ -161,8 +161,10 @@ class NoURLPatternsTests(TestCase):
|
||||
resolver = RegexURLResolver(r'^$', self.urls)
|
||||
|
||||
self.assertRaisesMessage(ImproperlyConfigured,
|
||||
"The included urlconf urlpatterns_reverse.no_urls "
|
||||
"doesn't have any patterns in it", getattr, resolver, 'url_patterns')
|
||||
"The included urlconf 'urlpatterns_reverse.no_urls' does not "
|
||||
"appear to have any patterns in it. If you see valid patterns in "
|
||||
"the file then the issue is probably caused by a circular import.",
|
||||
getattr, resolver, 'url_patterns')
|
||||
|
||||
|
||||
class URLPatternReverse(TestCase):
|
||||
|
||||
Reference in New Issue
Block a user