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:
committed by
Tim Graham
parent
7eb556a6c2
commit
7cc52250f0
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user