nubela nubela - 1 year ago 99
Python Question

How can I fake request.POST and GET params for unit testing in Flask?

I would like to fake request parameters for unit testing. How can I achieve this in Flask?


Answer Source

Did you read Flask docs about testing?

You can use following:'/path-to-request', data=dict(var1='data1', var2='data2', ...))'/path-to-request')