Skip to content

Support using JSONRenderer in TEST_REQUEST_RENDERER_CLASSES #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stianpr opened this issue Feb 3, 2016 · 2 comments
Closed

Support using JSONRenderer in TEST_REQUEST_RENDERER_CLASSES #199

stianpr opened this issue Feb 3, 2016 · 2 comments

Comments

@stianpr
Copy link

stianpr commented Feb 3, 2016

It would be very nice to use the JSONRenderer as default request renderer in tests. In latest release it will break because it does not have any renderer context. So by supporting this a test could look something like this:

client = APIClient()
response = client.patch(
   '/api/companies/1'
    {'name': 'A new company name'},
    format='vnd.api+json'
)
assert response.status_code == status.HTTP_200_OK

Then we don't have to build the payload for data in correct JSON API spec 1.0. The renderer does that for us.

@jerel
Copy link
Member

jerel commented Feb 22, 2016

@stianpr this would be a nice enhancement. I don't have time to implement it myself at the moment but would certainly welcome a PR.

@sliverc
Copy link
Member

sliverc commented May 2, 2018

This has been address with #396 hence closing this issue.

@sliverc sliverc closed this as completed May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants