diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-09-14 05:28:00 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-09-14 05:28:00 +0000 |
| commit | e70d7e60640e280f8d410d41c1f9cb6195483c4e (patch) | |
| tree | 601a16030a28d5709f3dfbfe87db8a82f596e03f /django/test | |
| parent | dc785104b8ffb33c57f5e17209743516c1bd88ae (diff) | |
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
Diffstat (limited to 'django/test')
| -rw-r--r-- | django/test/testcases.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py index baa6e7bb19..6b7714ec7b 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -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)) |
