You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, we are using this package and ran into an issue with our unit tests where it seems that the rest_framework APIRequestFactory which is behind the test client does not pass in a renderer_context:
def render(self, data, accepted_media_type=None, renderer_context=None):
> view = renderer_context.get("view", None)
E AttributeError: 'NoneType' object has no attribute 'get'
/usr/local/lib/python3.5/site-packages/rest_framework_json_api/renderers.py:419: AttributeError
I think you could fix it by doing renderer_context={}
The code from this library will break at the following lines which are not guarded properly:
Uh oh!
There was an error while loading. Please reload this page.
Hello, we are using this package and ran into an issue with our unit tests where it seems that the rest_framework APIRequestFactory which is behind the test client does not pass in a
renderer_context
:I think you could fix it by doing
renderer_context={}
The code from this library will break at the following lines which are not guarded properly:
https://github.com/django-json-api/django-rest-framework-json-api/blob/develop/rest_framework_json_api/renderers.py#L419
also:
https://github.com/django-json-api/django-rest-framework-json-api/blob/develop/rest_framework_json_api/renderers.py#L401
https://github.com/django-json-api/django-rest-framework-json-api/blob/develop/rest_framework_json_api/renderers.py#L420
Here is the corresponding rest_framework.test line that you can see does not include
renderer_context
as an argument:https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/test.py#L183
Let me know if this makes sense or if I'm off course!
Thanks
The text was updated successfully, but these errors were encountered: