diff options
| author | Adam Chainz <me@adamj.eu> | 2016-11-21 13:14:03 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-11-21 08:14:03 -0500 |
| commit | 19e2114634c322d5a58f3dd282a3a3cfd0f5aa24 (patch) | |
| tree | b48a1f7882e5bd399b1a51a4dc4b81df5ea19963 /tests | |
| parent | 0783aa7debc6720306e7f345e5beace07febba64 (diff) | |
Fixed #27516 -- Made test client's response.json() cache the parsed JSON.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_client_regress/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_client_regress/tests.py b/tests/test_client_regress/tests.py index 48ce51b091..7a633ee7a3 100644 --- a/tests/test_client_regress/tests.py +++ b/tests/test_client_regress/tests.py @@ -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"' |
