1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #30550 -- Fixed decoding of non-UTF-8 bytes objects in response.json().

This commit is contained in:
Jon Dufresne
2019-06-06 21:40:15 -07:00
committed by Mariusz Felisiak
parent 498092377b
commit d6ea4898c4
4 changed files with 11 additions and 1 deletions

View File

@@ -1204,6 +1204,11 @@ class RequestMethodStringDataTests(SimpleTestCase):
response = self.client.get('/json_response/')
self.assertEqual(response.json(), {'key': 'value'})
def test_json_charset(self):
response = self.client.get('/json_response_latin1/')
self.assertEqual(response.charset, 'latin1')
self.assertEqual(response.json(), {'a': 'Å'})
def test_json_structured_suffixes(self):
valid_types = (
'application/vnd.api+json',