Fixed #10065 -- Corrected an error message when an empty urlpattern object is provided. Thanks to Matthew Flanagan for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10385 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
2b1934ff3c
commit
ff166a3cdc
|
@ -0,0 +1,2 @@
|
||||||
|
#from django.conf.urls.defaults import *
|
||||||
|
|
|
@ -1,6 +1,19 @@
|
||||||
"""
|
"""
|
||||||
Unit tests for reverse URL lookups.
|
Unit tests for reverse URL lookups.
|
||||||
"""
|
"""
|
||||||
|
__test__ = {'API_TESTS': """
|
||||||
|
|
||||||
|
RegexURLResolver should raise an exception when no urlpatterns exist.
|
||||||
|
|
||||||
|
>>> from django.core.urlresolvers import RegexURLResolver
|
||||||
|
>>> no_urls = 'regressiontests.urlpatterns_reverse.no_urls'
|
||||||
|
>>> resolver = RegexURLResolver(r'^$', no_urls)
|
||||||
|
>>> resolver.url_patterns
|
||||||
|
Traceback (most recent call last):
|
||||||
|
...
|
||||||
|
ImproperlyConfigured: The included urlconf regressiontests.urlpatterns_reverse.no_urls doesn't have any patterns in it
|
||||||
|
"""}
|
||||||
|
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse, NoReverseMatch
|
from django.core.urlresolvers import reverse, NoReverseMatch
|
||||||
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect
|
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect
|
||||||
|
|
Loading…
Reference in New Issue