summaryrefslogtreecommitdiff
path: root/tests/test_client
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-02-10 20:19:26 -0500
committerTim Graham <timograham@gmail.com>2018-02-12 10:20:53 -0500
commit4206765a5b157bd6149d9e1aaf459fd4296e9b89 (patch)
treec39000a2634e712d484d4499af71a16f70ed5505 /tests/test_client
parent43b148f41fa7a5c3f74e0198d9c72074abe9a9bc (diff)
downloaddjango-4206765a5b157bd6149d9e1aaf459fd4296e9b89.tar.gz
Refs #20530 -- Added a test for test client query string encoding.
7bb627936034c1b9500a8d250cce75b30f980b23 is only tested in django-contrib-comments.
Diffstat (limited to 'tests/test_client')
-rw-r--r--tests/test_client/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_client/tests.py b/tests/test_client/tests.py
index 393678ca03..e5bd1dac75 100644
--- a/tests/test_client/tests.py
+++ b/tests/test_client/tests.py
@@ -54,6 +54,11 @@ class ClientTest(TestCase):
self.assertEqual(response.context['var'], '\xf2')
self.assertEqual(response.templates[0].name, 'GET Template')
+ def test_query_string_encoding(self):
+ # WSGI requires latin-1 encoded strings.
+ response = self.client.get('/get_view/?var=1\ufffd')
+ self.assertEqual(response.context['var'], '1\ufffd')
+
def test_get_post_view(self):
"GET a view that normally expects POSTs"
response = self.client.get('/post_view/', {})