Merge "Fixed getting the location header"

This commit is contained in:
Zuul 2021-10-27 14:26:49 +00:00 committed by Gerrit Code Review
commit 8704da6f4a

View File

@ -200,7 +200,10 @@ class TestCase(horizon_helpers.TestCase):
processing the view which is redirected to. processing the view which is redirected to.
""" """
if django.VERSION >= (1, 9): if django.VERSION >= (1, 9):
loc = str(response._headers.get('location', None)[1]) if response.has_header('location'):
loc = response['location']
else:
loc = ''
loc = http.urlunquote(loc) loc = http.urlunquote(loc)
expected_url = http.urlunquote(expected_url) expected_url = http.urlunquote(expected_url)
self.assertEqual(loc, expected_url) self.assertEqual(loc, expected_url)