Refs #20530 -- Added a test for test client query string encoding.

7bb6279360 is only tested in
django-contrib-comments.
This commit is contained in:
Tim Graham 2018-02-10 20:19:26 -05:00
parent 43b148f41f
commit 4206765a5b
1 changed files with 5 additions and 0 deletions

View File

@ -54,6 +54,11 @@ class ClientTest(TestCase):
self.assertEqual(response.context['var'], '\xf2') self.assertEqual(response.context['var'], '\xf2')
self.assertEqual(response.templates[0].name, 'GET Template') 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): def test_get_post_view(self):
"GET a view that normally expects POSTs" "GET a view that normally expects POSTs"
response = self.client.get('/post_view/', {}) response = self.client.get('/post_view/', {})