mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #21157 -- Fixed problems with ResolverMatch
- Fixed bug in get_callable() that caused resolve() to put a string in ResolverMatch.func. - Made ResolverMatch.url_name match the actual url name (or None). - Updated tests that used the string value in ResolverMatch.func, and added regression tests for this bug. - Corrected test urls whose dummy view paths caused failures (behavior that was previously masked by this bug).
This commit is contained in:
committed by
Tim Graham
parent
0aa4c6c391
commit
91afc00513
@@ -62,14 +62,14 @@ with warnings.catch_warnings(record=True):
|
||||
url(r'^(?:foo|bar)(\w+)/$', empty_view, name="disjunction"),
|
||||
|
||||
# Regression views for #9038. See tests for more details
|
||||
url(r'arg_view/$', 'kwargs_view'),
|
||||
url(r'arg_view/(?P<arg1>[0-9]+)/$', 'kwargs_view'),
|
||||
url(r'arg_view/$', 'urlpatterns_reverse.views.kwargs_view'),
|
||||
url(r'arg_view/(?P<arg1>[0-9]+)/$', 'urlpatterns_reverse.views.kwargs_view'),
|
||||
url(r'absolute_arg_view/(?P<arg1>[0-9]+)/$', absolute_kwargs_view),
|
||||
url(r'absolute_arg_view/$', absolute_kwargs_view),
|
||||
|
||||
# Tests for #13154. Mixed syntax to test both ways of defining URLs.
|
||||
url(r'defaults_view1/(?P<arg1>[0-9]+)/', 'defaults_view', {'arg2': 1}, name='defaults'),
|
||||
(r'defaults_view2/(?P<arg1>[0-9]+)/', 'defaults_view', {'arg2': 2}, 'defaults'),
|
||||
url(r'defaults_view1/(?P<arg1>[0-9]+)/', 'urlpatterns_reverse.views.defaults_view', {'arg2': 1}, name='defaults'),
|
||||
(r'defaults_view2/(?P<arg1>[0-9]+)/', 'urlpatterns_reverse.views.defaults_view', {'arg2': 2}, 'defaults'),
|
||||
|
||||
url('^includes/', include(other_patterns)),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user