nubela nubela - 1 year ago 109
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')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download