On Jan 25, 9:32 am, Oleg Oltar <[email protected]> wrote:
> Hi!
> Can you please explain me idea of testing django applications with Client()
>
> There many examples in doc, where test cases just checked the
> response.status_code == 200,
>
> But I am often getting 302 instead of 200. Is there any workaround in this
> case?
>
If you are doing a POST and a Redirect then you will get 302 or if you
test a URL with the trailing slash you will get a 302 to redirect to
the complete URL with the trailing slash.
So either you should be checking for a 302 or you should use the
complete URL would be my guess. More information is required for
further debugging.
--
Milan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---