diff options
| author | Unai Zalakain <unai@gisa-elkartea.org> | 2014-10-31 17:43:34 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-11-03 07:59:19 -0500 |
| commit | c548c8d0d1112d2c4bace2eebf73ede35300d842 (patch) | |
| tree | a0d8e3089302139c6a24b6262d37ab2eb55fb4c8 /tests/requests | |
| parent | d3db878e4beff057400dd780c24f3601a5d31f95 (diff) | |
Fixed #18456 -- Added path escaping to HttpRequest.get_full_path().
Diffstat (limited to 'tests/requests')
| -rw-r--r-- | tests/requests/tests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/requests/tests.py b/tests/requests/tests.py index 36d1d80a69..22b3021d1f 100644 --- a/tests/requests/tests.py +++ b/tests/requests/tests.py @@ -35,6 +35,19 @@ class RequestsTests(SimpleTestCase): # and FILES should be MultiValueDict self.assertEqual(request.FILES.getlist('foo'), []) + def test_httprequest_full_path(self): + request = HttpRequest() + request.path = request.path_info = '/;some/?awful/=path/foo:bar/' + request.META['QUERY_STRING'] = ';some=query&+query=string' + expected = '/%3Bsome/%3Fawful/%3Dpath/foo:bar/?;some=query&+query=string' + self.assertEqual(request.get_full_path(), expected) + + def test_httprequest_full_path_with_query_string_and_fragment(self): + request = HttpRequest() + request.path = request.path_info = '/foo#bar' + request.META['QUERY_STRING'] = 'baz#quux' + self.assertEqual(request.get_full_path(), '/foo%23bar?baz#quux') + def test_httprequest_repr(self): request = HttpRequest() request.path = '/somepath/' |
