summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-06-27 14:50:03 -0400
committerTim Graham <timograham@gmail.com>2018-06-27 16:52:06 -0400
commit01b7fdfd67a87e8c881e34d7ed97767c506b189c (patch)
treeba45e6537ba0abe26c2508e2ca26a36929c7233d /tests
parentda46599143408be58c1845b8c82cacbae0bb56c0 (diff)
[2.1.x] Fixed #29520 -- Fixed test client crash when posting bytes.
Regression in b8a41a2872624a6d9e61308932dd81d001e31eb9. Backport of 9294110a57ce0a6d14506969c950090045c622c8 from master
Diffstat (limited to 'tests')
-rw-r--r--tests/test_client_regress/tests.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_client_regress/tests.py b/tests/test_client_regress/tests.py
index 00e1b01766..36b28d3a92 100644
--- a/tests/test_client_regress/tests.py
+++ b/tests/test_client_regress/tests.py
@@ -1196,6 +1196,10 @@ class RequestMethodStringDataTests(SimpleTestCase):
response = self.client.head('/body/', data='', content_type='application/json')
self.assertEqual(response.content, b'')
+ def test_json_bytes(self):
+ response = self.client.post('/body/', data=b"{'value': 37}", content_type='application/json')
+ self.assertEqual(response.content, b"{'value': 37}")
+
def test_json(self):
response = self.client.get('/json_response/')
self.assertEqual(response.json(), {'key': 'value'})