I\'m currently writing up some basic tests to ensure pages in a medium sized Django application are GETting and POSTing correctly. However, using django.test.client.Client isn\
It's not totally clear why you're getting a redirect, but if you want to follow it you need to tell RequestClient
to follow redirects - per the documentation:
If you set
follow
toTrue
the client will follow any redirects and aredirect_chain
attribute will be set in the response object containing tuples of the intermediate urls and status codes.
So your test code should look like:
python
response = client.post("/app/mymodel/create/", follow=True)
It'd be worth checking the request chain to see where exactly it was routed.