incuna / incuna-test-utils

TestCases and other helpers for testing Django apps.
BSD 2-Clause "Simplified" License
7 stars 7 forks source link

Use request.data instead of request.DATA #60

Open kevinetienne opened 8 years ago

kevinetienne commented 8 years ago

I'm not sure if Django uses request.data still, but django-rest-framework requires request.data instead of 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.

Example:

view = MyView()
view.request = self.create_request(data={})
meshy commented 8 years ago

request.DATA is a remnant of DRF 2, and can be replaced in newer versions.

Django used to have request.REQUEST, which was similar.