1
0
mirror of https://github.com/django/django.git synced 2025-03-31 11:37:06 +00:00

Fixed "URLconf" spelling in code comments.

This commit is contained in:
Tim Graham 2015-10-22 14:46:42 -04:00
parent c08f85fd54
commit 37ea3cb03e
8 changed files with 13 additions and 13 deletions
django
core
views/generic
tests
i18n/patterns
middleware
urlpatterns_reverse
urls.py
view_tests/tests

@ -126,7 +126,7 @@ class BaseHandler(object):
if response is None: if response is None:
if hasattr(request, 'urlconf'): if hasattr(request, 'urlconf'):
# Reset url resolver with a custom urlconf. # Reset url resolver with a custom URLconf.
urlconf = request.urlconf urlconf = request.urlconf
urlresolvers.set_urlconf(urlconf) urlresolvers.set_urlconf(urlconf)
resolver = urlresolvers.get_resolver(urlconf) resolver = urlresolvers.get_resolver(urlconf)

@ -135,9 +135,9 @@ def get_resolver(urlconf=None):
@lru_cache.lru_cache(maxsize=None) @lru_cache.lru_cache(maxsize=None)
def get_ns_resolver(ns_pattern, resolver): def get_ns_resolver(ns_pattern, resolver):
# Build a namespaced resolver for the given parent urlconf pattern. # Build a namespaced resolver for the given parent URLconf pattern.
# This makes it possible to have captured parameters in the parent # This makes it possible to have captured parameters in the parent
# urlconf pattern. # URLconf pattern.
ns_resolver = RegexURLResolver(ns_pattern, resolver.url_patterns) ns_resolver = RegexURLResolver(ns_pattern, resolver.url_patterns)
return RegexURLResolver(r'^/', [ns_resolver]) return RegexURLResolver(r'^/', [ns_resolver])
@ -381,7 +381,7 @@ class RegexURLResolver(LocaleRegexProvider):
iter(patterns) iter(patterns)
except TypeError: except TypeError:
msg = ( msg = (
"The included urlconf '{name}' does not appear to have any " "The included URLconf '{name}' does not appear to have any "
"patterns in it. If you see valid patterns in the file then " "patterns in it. If you see valid patterns in the file then "
"the issue is probably caused by a circular import." "the issue is probably caused by a circular import."
) )

@ -151,7 +151,7 @@ class TemplateResponseMixin(object):
class TemplateView(TemplateResponseMixin, ContextMixin, View): class TemplateView(TemplateResponseMixin, ContextMixin, View):
""" """
A view that renders a template. This view will also pass into the context A view that renders a template. This view will also pass into the context
any keyword arguments passed by the url conf. any keyword arguments passed by the URLconf.
""" """
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
context = self.get_context_data(**kwargs) context = self.get_context_data(**kwargs)

@ -94,7 +94,7 @@ class URLDisabledTests(URLTestCaseBase):
@override_settings(ROOT_URLCONF='i18n.patterns.urls.path_unused') @override_settings(ROOT_URLCONF='i18n.patterns.urls.path_unused')
class PathUnusedTests(URLTestCaseBase): class PathUnusedTests(URLTestCaseBase):
""" """
Check that if no i18n_patterns is used in root urlconfs, then no Check that if no i18n_patterns is used in root URLconfs, then no
language activation happens based on url prefix. language activation happens based on url prefix.
""" """

@ -151,7 +151,7 @@ class CommonMiddlewareTest(SimpleTestCase):
self.assertEqual(r.url, self.assertEqual(r.url,
'http://www.testserver/slash/') 'http://www.testserver/slash/')
# The following tests examine expected behavior given a custom urlconf that # The following tests examine expected behavior given a custom URLconf that
# overrides the default one through the request object. # overrides the default one through the request object.
@override_settings(APPEND_SLASH=True) @override_settings(APPEND_SLASH=True)

@ -273,7 +273,7 @@ class NoURLPatternsTests(SimpleTestCase):
self.assertRaisesMessage( self.assertRaisesMessage(
ImproperlyConfigured, ImproperlyConfigured,
"The included urlconf 'urlpatterns_reverse.no_urls' does not " "The included URLconf 'urlpatterns_reverse.no_urls' does not "
"appear to have any patterns in it. If you see valid patterns in " "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.", "the file then the issue is probably caused by a circular import.",
getattr, resolver, 'url_patterns' getattr, resolver, 'url_patterns'
@ -364,7 +364,7 @@ class ResolverTests(unittest.TestCase):
Test repr of RegexURLResolver, especially when urlconf_name is a list Test repr of RegexURLResolver, especially when urlconf_name is a list
(#17892). (#17892).
""" """
# Pick a resolver from a namespaced urlconf # Pick a resolver from a namespaced URLconf
resolver = get_resolver('urlpatterns_reverse.namespace_urls') resolver = get_resolver('urlpatterns_reverse.namespace_urls')
sub_resolver = resolver.namespace_dict['test-ns1'][1] sub_resolver = resolver.namespace_dict['test-ns1'][1]
self.assertIn('<RegexURLPattern list>', repr(sub_resolver)) self.assertIn('<RegexURLPattern list>', repr(sub_resolver))
@ -923,7 +923,7 @@ class DefaultErrorHandlerTests(SimpleTestCase):
@override_settings(ROOT_URLCONF=None) @override_settings(ROOT_URLCONF=None)
class NoRootUrlConfTests(SimpleTestCase): class NoRootUrlConfTests(SimpleTestCase):
"""Tests for handler404 and handler500 if urlconf is None""" """Tests for handler404 and handler500 if ROOT_URLCONF is None"""
def test_no_handler_exception(self): def test_no_handler_exception(self):
self.assertRaises(ImproperlyConfigured, self.client.get, '/test/me/') self.assertRaises(ImproperlyConfigured, self.client.get, '/test/me/')

@ -1,4 +1,4 @@
"""This urlconf exists because Django expects ROOT_URLCONF to exist. URLs """This URLconf exists because Django expects ROOT_URLCONF to exist. URLs
should be added within the test folders, and use TestCase.urls to set them. should be added within the test folders, and use TestCase.urls to set them.
This helps the tests remain isolated. This helps the tests remain isolated.
""" """

@ -174,9 +174,9 @@ class DebugViewTests(LoggingCaptureMixin, SimpleTestCase):
@override_settings(ROOT_URLCONF='view_tests.default_urls') @override_settings(ROOT_URLCONF='view_tests.default_urls')
def test_default_urlconf_template(self): def test_default_urlconf_template(self):
""" """
Make sure that the default urlconf template is shown shown instead Make sure that the default URLconf template is shown shown instead
of the technical 404 page, if the user has not altered their of the technical 404 page, if the user has not altered their
url conf yet. URLconf yet.
""" """
response = self.client.get('/') response = self.client.get('/')
self.assertContains( self.assertContains(