Following redirects with the Django test client

When running unit tests with in Django, the test client’s default behaviour is to stop at the first response, even if that response is a redirect. If you want the client to follow these redirects and return the last page, perform your requests like this: response = c.get(‘/redirect_me/’, follow=True) This will also add response.redirect_chain so […]