nubela nubela - 6 months ago 31
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?



Did you read Flask docs about testing?

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