Skip to content

Instantly share code, notes, and snippets.

View austrokhart's full-sized avatar

Dmitry austrokhart

View GitHub Profile
@rverton
rverton / test_file_upload.py
Created August 2, 2016 15:00
Test file upload with flask (Python3)
from io import BytesIO
def test_file_upload(client):
data = {
'field': 'value',
'file': (BytesIO(b'FILE CONTENT'), 'test.csv')
}
rv = client.post('/upload', buffered=True,