From eb25a40c0711f38e118efc0d7b78a4ceefb22fef Mon Sep 17 00:00:00 2001 From: blag Date: Mon, 20 Dec 2021 01:53:47 -0800 Subject: [PATCH] Use response.url instead of digging through mock response headers --- tos/tests/test_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tos/tests/test_views.py b/tos/tests/test_views.py index 44d88c4..0be8b2c 100644 --- a/tos/tests/test_views.py +++ b/tos/tests/test_views.py @@ -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."""