nubela nubela - 10 months ago 49
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')