Open kevinetienne opened 8 years ago
I'm not sure if Django uses request.data still, but django-rest-framework requires request.data instead of request.DATA.
Django
request.data
django-rest-framework
request.DATA
Changing it for the lowercase version in api_request would make it easy to write test when the request is set as a view attribute in tests.
api_request
Example:
view = MyView() view.request = self.create_request(data={})
request.DATA is a remnant of DRF 2, and can be replaced in newer versions.
Django used to have request.REQUEST, which was similar.
request.REQUEST
I'm not sure if
Django
usesrequest.data
still, butdjango-rest-framework
requiresrequest.data
instead ofrequest.DATA
.Changing it for the lowercase version in
api_request
would make it easy to write test when the request is set as a view attribute in tests.Example: