Two things you need to know:

1) If you expect a status other than 200 OK your test needs to specify
it or you get an error:
        response = self.app.post(..., status=302)
2) The redirect location ends up in response.response.location; you
can check it or follow it, e.g.:
        response = self.app.get(response.response.location)

It may be possible in tests to hide the following of redirects but I
prefer to keep it explicit.

Hope that helps
Mike
[email protected]
http://positiveincline.com
http://twitter.com/asplake


On Dec 18, 3:37 pm, jerry <[email protected]> wrote:
> Hi,
>
> When a view returns HTTPFound, how should I write unit test that
> follows the (possible multiple) redirection and asserts the final
> response?
>
> Thanks in advance!
>
> Jerry

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to