summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/httpwrappers/tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/regressiontests/httpwrappers/tests.py b/tests/regressiontests/httpwrappers/tests.py
index 6d452524fe..65b06a1d77 100644
--- a/tests/regressiontests/httpwrappers/tests.py
+++ b/tests/regressiontests/httpwrappers/tests.py
@@ -71,6 +71,16 @@ class QueryDictTests(unittest.TestCase):
self.assertEqual(q.urlencode(), 'foo=bar')
+ def test_urlencode(self):
+ q = QueryDict('', mutable=True)
+ q['next'] = '/a&b/'
+ self.assertEqual(q.urlencode(), 'next=%2Fa%26b%2F')
+ self.assertEqual(q.urlencode(safe='/'), 'next=/a%26b/')
+ q = QueryDict('', mutable=True)
+ q['next'] = u'/t\xebst&key/'
+ self.assertEqual(q.urlencode(), 'next=%2Ft%C3%ABst%26key%2F')
+ self.assertEqual(q.urlencode(safe='/'), 'next=/t%C3%ABst%26key/')
+
def test_mutable_copy(self):
"""A copy of a QueryDict is mutable."""
q = QueryDict('').copy()