1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #29662 -- Allowed test client to accept structured suffix JSON content types.

This commit is contained in:
Marnanel Thurman
2018-08-15 15:27:45 +01:00
committed by Tim Graham
parent 7eb556a6c2
commit 7cc52250f0
3 changed files with 8 additions and 3 deletions

View File

@@ -1204,11 +1204,13 @@ class RequestMethodStringDataTests(SimpleTestCase):
response = self.client.get('/json_response/')
self.assertEqual(response.json(), {'key': 'value'})
def test_json_vendor(self):
def test_json_structured_suffixes(self):
valid_types = (
'application/vnd.api+json',
'application/vnd.api.foo+json',
'application/json; charset=utf-8',
'application/activity+json',
'application/activity+json; charset=utf-8',
)
for content_type in valid_types:
response = self.client.get('/json_response/', {'content_type': content_type})