mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #29775 -- Fixed URL converters in a nested namespaced path.
When using include() without namespaces of some urlpatterns that have an include() with namespace, the converters of the parent include() weren't being used to convert the arguments of reverse().
This commit is contained in:
parent
b8b1d8cad6
commit
b0b4aac555
4 changed files with 18 additions and 0 deletions
|
|
@ -70,6 +70,13 @@ class SimplifiedURLTests(SimpleTestCase):
|
|||
url = reverse(url_name, kwargs=kwargs)
|
||||
self.assertEqual(url, expected)
|
||||
|
||||
@override_settings(ROOT_URLCONF='urlpatterns.path_base64_urls')
|
||||
def test_converter_reverse_with_second_layer_instance_namespace(self):
|
||||
kwargs = included_kwargs.copy()
|
||||
kwargs['last_value'] = b'world'
|
||||
url = reverse('instance-ns-base64:subsubpattern-base64', kwargs=kwargs)
|
||||
self.assertEqual(url, '/base64/aGVsbG8=/subpatterns/d29ybGQ=/d29ybGQ=/')
|
||||
|
||||
def test_path_inclusion_is_matchable(self):
|
||||
match = resolve('/included_urls/extra/something/')
|
||||
self.assertEqual(match.url_name, 'inner-extra')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue