def runTest(self):
    with open(self.dir + '/img/img1.jpg', 'rb') as img1:
        img1StringIO = StringIO(img1.read())
response = self.app.post('/convert', content_type='multipart/form-data',
    data={'photo': (img1StringIO, 'img1.jpg')}, follow_redirects=True)
img1StringIO.seek(0)
How to test send_file flask