mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-07 13:54:47 +03:00
Updte CoreJSON media type
This commit is contained in:
parent
3eb7fe6f64
commit
5858168d55
|
@ -813,7 +813,7 @@ class MultiPartRenderer(BaseRenderer):
|
|||
|
||||
|
||||
class CoreJSONRenderer(BaseRenderer):
|
||||
media_type = 'application/vnd.coreapi+json'
|
||||
media_type = 'application/coreapi+json'
|
||||
charset = None
|
||||
format = 'corejson'
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ urlpatterns = [
|
|||
class TestRouterGeneratedSchema(TestCase):
|
||||
def test_anonymous_request(self):
|
||||
client = APIClient()
|
||||
response = client.get('/', HTTP_ACCEPT='application/vnd.coreapi+json')
|
||||
response = client.get('/', HTTP_ACCEPT='application/coreapi+json')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
expected = coreapi.Document(
|
||||
url='',
|
||||
|
@ -124,7 +124,7 @@ class TestRouterGeneratedSchema(TestCase):
|
|||
def test_authenticated_request(self):
|
||||
client = APIClient()
|
||||
client.force_authenticate(MockUser())
|
||||
response = client.get('/', HTTP_ACCEPT='application/vnd.coreapi+json')
|
||||
response = client.get('/', HTTP_ACCEPT='application/coreapi+json')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
expected = coreapi.Document(
|
||||
url='',
|
||||
|
|
Loading…
Reference in New Issue
Block a user