I'm trying to implement unit tests for my django rest framework project. I send protobuf files.
My code is:
def test_post(self):
files_dir = os.path.join(settings.BASE_DIR, 'api/test_files')
path = files_dir + '/test1_test2.bin'
myfile = open(path,'rb')
self.guest_client.post(
'/config?content-disposition=%20attachment%3Bfilename%3D%22test1_test2.bin%22',
data={'file': myfile, },
content_type='application/octet-stream'
)
And nothing happens. Where did I do wrong?