Ticket #10065: urlconfexception2.diff
File urlconfexception2.diff, 1.8 KB (added by , 16 years ago) |
---|
-
django/core/urlresolvers.py
206 206 try: 207 207 iter(patterns) 208 208 except TypeError: 209 raise ImproperlyConfigured("The included urlconf %s doesn't have any "209 raise ImproperlyConfigured("The included urlconf %s doesn't have any " 210 210 "patterns in it" % self.urlconf_name) 211 211 return patterns 212 212 url_patterns = property(_get_url_patterns) -
tests/regressiontests/url_resolvers/no_urls.py
1 #from django.conf.urls.defaults import * 2 -
tests/regressiontests/url_resolvers/tests.py
1 __test__ = {'API_TESTS': """ 2 3 RegexURLResolver should raise an exception when no urlpatterns exist. 4 5 >>> from django.core.urlresolvers import RegexURLResolver 6 >>> no_urls = 'regressiontests.url_resolvers.no_urls' 7 >>> resolver = RegexURLResolver(r'^$', no_urls) 8 >>> resolver.url_patterns 9 Traceback (most recent call last): 10 ... 11 ImproperlyConfigured: The included urlconf regressiontests.url_resolvers.no_urls doesn't have any patterns in it 12 """}