Hi i'm trying to test and endpoint that will need a file and some values, when i upload only the file there is not problem, but when i add the values it throws:
TypeError: 'str' does not support the buffer interface
my code is like this:
headers = {'content-Type': 'multipart/form-data'}
response = self.client.post(base_url, headers=headers, data=dict(
some_value='test', some_other_value=False, image=(BytesIO(self.test_image), 'image.png'))
if i do this it works:
headers = {'content-Type': 'multipart/form-data'}
response = self.client.post(base_url, headers=headers, data=dict(
image=(BytesIO(self.test_image), 'image.png'))