mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #21177 -- Made resolve_url support relative URLs.
This fixes redirecting to relative URLs with django.shortcuts.redirect.
This commit is contained in:
parent
f3805f5c52
commit
e3d0790bd0
4 changed files with 24 additions and 2 deletions
|
@ -21,6 +21,16 @@ class ResolveUrlTests(TestCase):
|
|||
"""
|
||||
self.assertEqual('/something/', resolve_url('/something/'))
|
||||
|
||||
def test_relative_path(self):
|
||||
"""
|
||||
Tests that passing a relative URL path to ``resolve_url`` will result
|
||||
in the same url.
|
||||
"""
|
||||
self.assertEqual('../', resolve_url('../'))
|
||||
self.assertEqual('../relative/', resolve_url('../relative/'))
|
||||
self.assertEqual('./', resolve_url('./'))
|
||||
self.assertEqual('./relative/', resolve_url('./relative/'))
|
||||
|
||||
def test_full_url(self):
|
||||
"""
|
||||
Tests that passing a full URL to ``resolve_url`` will result in the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue