pallets-eco / flask-openid

Flask-OpenID adds openid support to flask applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flask-OpenID unit testing

rith87 opened this issue · comments

Hello,

I'd like to write some unit tests for my app when using flask-openid but the Flask test client doesn't allow for external redirects. Any good workarounds? FYI, I've posted this question on http://stackoverflow.com/questions/21655601/flask-openid-unittest as well but I didn't get any attempts at an answer :(

About the only things you can do here is either also setup an OpenID server in your application during test time (there's a good one in the python-openid repository, in the examples/ directory), or to fake the OpenID process by generating and signing the OpenID response yourself (and thus be a provider just for testing cases).
Also, you could maybe switch flask-openid for some fake system that looks the same to the application but doesn't actually do OpenID for the test case.

Since neither of these options are really solvable inside Flask-OpenID, I am going to close this issue, but if you need help with any of these options, feel free to email me or ping me on freenode.