Thank you Russ, that has fixed the problem.
I have a problem with the fix though; what if there were multiple
redirects? This just happened when I jumped to use your fix today:
/usermanagement
redirects to
/usermanagement/
which redirects to
/usermanagement/users/
in my application. I don't know how to use assertRedirect in this
scenario:
response = self.client.get('/usermanagement')
(1)
self.assertRedirects(response, '/usermanagement//users/',
status_code=301)
This will print
AssertionError: Response redirected to '/usermanagement/', expected '/
usermanagement/users/'
(2)
(1)
self.assertRedirects(response, '/usermanagement/', status_code=301)
This will print
AssertionError: Couldn't retrieve redirection page '/usermanagement/':
response code was 301 (expected 301)
This calls for some loop in the code of assertRedirects but I don't
know where to place it and how to check the redirect chain has
finished (return code starts with '3'?) - and detect infinte loops
possibly.
I hate to bother you but please explain this to me or, could you fix
it?
Thank you,
Jiri
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---