Thanks ... I'd din't see the follow parameter. It works like a
charm.. :)
On Mar 19, 3:38 pm, Alex Gaynor <[email protected]> wrote:
> On Thu, Mar 19, 2009 at 9:22 AM, Johan <[email protected]> wrote:
>
> > Hiya,
>
> > I trying to write test code for my views. I am using the following
> > approach.
>
> > >>>from django.test.client import Clien
> > >>>c = Client()
> > >>>c.get('/courses/system/home').status_code
> > 301
>
> > The question is now: How do I 'redirect' in my code? I would expect
> > something along the lines of:
>
> > >>> response = c.get('/courses/system/home')
> > >>> if response.status_code == 301:
> > >>> actual_response = c.get(response.ulr)
>
> > Any ideas? Help? Pointers to documentation?
>
> > Thanks
>
> In the Django development version you can do
> this:http://docs.djangoproject.com/en/dev/topics/testing/?from=olddocs#dja...
> the bits on follow = True. On 1.0 you'll need to do it manually.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---