'An assertion is raised if the response doesn\'t have the scheme specified in expected_url'

def test_redirect_scheme(self):

    for (follow, secure) in itertools.product([True, False], repeat=2):
        response = self.client.get('/https_redirect_view/', follow=follow, secure=secure)
        self.assertRedirects(response, 'https://testserver/secure_view/', status_code=302)
        with self.assertRaises(AssertionError):
            self.assertRedirects(response, 'http://testserver/secure_view/', status_code=302)
