Use response.url instead of digging through mock response headers

This commit is contained in:
blag 2021-12-20 01:53:47 -08:00
parent c9923e1639
commit eb25a40c07
No known key found for this signature in database
GPG key ID: 30870D32F59C5F40

View file

@ -89,7 +89,7 @@ class TestViews(TestCase):
response = self.client.post(self.login_url, dict(username='user1',
password='user1pass', next='http://example.com'))
self.assertEqual(302, response.status_code)
self.assertIn(settings.LOGIN_REDIRECT_URL, response._headers['location'][1])
self.assertIn(settings.LOGIN_REDIRECT_URL, response.url)
def test_need_to_log_in(self):
""" GET to login url shows login tempalte."""