'An assertion is raised if the response redirects to another target'

def test_incorrect_target(self):

    response = self.client.get('/permanent_redirect_view/')
    try:
        self.assertRedirects(response, '/some_view/')
    except AssertionError as e:
        self.assertIn("Response    didn't    redirect    as    expected:    Response    code    was    301    (expected    302)", str(e))
