support django 2.1+ test client json data automatically serialized by terencehonles · Pull Request #6511 · encode/django-rest-framework (original) (raw)
Sure, I'll rebase and mention it.
One thing that I realized with this request factory, when testing something yesterday, is that it returns a Django not a DRF request. This means that trying to access the request.data
doesn't work. I had to wrap it in a DRF request manually so I switched back to the native factory to get the encoding and not to confuse my peers since this PR still hasn't landed.
I will look at the code, but would it be acceptable to return a DRF request instead? It proxies the native request so it's not a breaking change. I will look at the code, but from memory I think I can actually initialize it in way that would make sense. I will also look at the test client to make sure it does not rely on the factory or that if it does it works correctly.