mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Fixed #27516 -- Made test client's response.json() cache the parsed JSON.
This commit is contained in:
parent
0783aa7deb
commit
19e2114634
2 changed files with 12 additions and 6 deletions
|
@ -1209,6 +1209,10 @@ class RequestMethodStringDataTests(SimpleTestCase):
|
|||
response = self.client.get('/json_response/')
|
||||
self.assertEqual(response.json(), {'key': 'value'})
|
||||
|
||||
def test_json_multiple_access(self):
|
||||
response = self.client.get('/json_response/')
|
||||
self.assertIs(response.json(), response.json())
|
||||
|
||||
def test_json_wrong_header(self):
|
||||
response = self.client.get('/body/')
|
||||
msg = 'Content-Type header is "text/html; charset=utf-8", not "application/json"'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue