File "/home/kae/hg/kae/web2py/gluon/tools.py", line 934, in <lambda>
settings.on_failed_authentication = lambda x: redirect(x)
File "/home/kae/hg/kae/web2py/gluon/http.py", line 128, in redirect
Location=location)
HTTP: 303 SEE OTHER
One could argue that's a "correct" failure because the test suite isn't
authenticated, but I'd like to use unit tests to test functions that need
authentication. I don't want to test the authentication mechanism itself.
Is there a way to fake authentication to allow unit testing? Do others
have a better way of doing this?
--
"You can have everything in life you want if you help enough other people
get what they want" - Zig Ziglar.
Who did you help today?
from gluon.storage import Storage
auth.user = Storage(dict(id=1))