I'm using DummyRequest in my tests to test authentication, this is what I
return from the view when login succeeds
headers = remember(request, email)
return HTTPFound(location=next, headers=headers)
This is my test
request = testing.DummyRequest(post={'usr': '[email protected]',
'pwd': 'mypassword'})
view = views.login(request)
print(view.headers)
print(request.headers)
print(unauthenticated_userid(request))
print(authenticated_userid(request))
The first print shows some headers but none related to authentication. The
last 3 prints return nothing, which is not what I expected (login did
succeed). I've set a default AuthTktAuthenticationPolicy in my config.
How can I test that authentication has worked?
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.