I found a workaround: first send a login request without cookies to *get* 
the session cookie from web2py, and then do a second login request with the 
cookie, to give web2py a chance to set the session data. This sets up my 
tester with a valid session cookie, which corresponds to valid session data 
in web2py, and my testing can start.

This is a dirty way of handling the redirect (actually, it is *not* 
handling the redirect, which is still handled internally - twice - in 
urrlib2), but since I do not yet know how to modify WebClient to properly 
handle redirects, I will have to settle with this for the time being.

On Monday, December 24, 2012 2:38:48 PM UTC+1, Daniel Gonzalez wrote:
>
> Trying to answer some of my questions.
> The redirects are handled by the client. In the case of WebClient probably 
> by the urrlib2 library.
> Now my question is: how do I tell the urllib2 library used by WebClient to 
> properly setup the cookies when following a redirect?
>
> Thanks,
> Daniel
>

-- 



Reply via email to