mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #987 -- Convert relative URI portions into absolute URIs in HTTP Location headers. Based on a patch from SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6164 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -84,12 +84,8 @@ class TestCase(unittest.TestCase):
|
||||
self.assertEqual(response.status_code, status_code,
|
||||
("Response didn't redirect as expected: Response code was %d"
|
||||
" (expected %d)" % (response.status_code, status_code)))
|
||||
scheme, netloc, path, query, fragment = urlsplit(response['Location'])
|
||||
url = path
|
||||
if query:
|
||||
url += '?' + query
|
||||
if fragment:
|
||||
url += '#' + fragment
|
||||
url = response['Location']
|
||||
scheme, netloc, path, query, fragment = urlsplit(url)
|
||||
self.assertEqual(url, expected_url,
|
||||
"Response redirected to '%s', expected '%s'" % (url, expected_url))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user