How can I test binary file uploading with django-rest-framework’s test client?
When testing file uploads, you should pass the stream object into the request, not the data. This was pointed out in the comments by @arocks Pass { ‘image’: file} instead But that didn’t full explain why it was needed (and also didn’t match the question). For this specific question, you should be doing from PIL … Read more