diff --git a/heat_dashboard/test/helpers.py b/heat_dashboard/test/helpers.py index 8b45aa85..fadf09fd 100644 --- a/heat_dashboard/test/helpers.py +++ b/heat_dashboard/test/helpers.py @@ -200,7 +200,10 @@ class TestCase(horizon_helpers.TestCase): processing the view which is redirected to. """ 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) expected_url = http.urlunquote(expected_url) self.assertEqual(loc, expected_url)