Fixed getting the location header
The old response._headers.get() doesn't work anymore with newer Django. This patch fixes it. Change-Id: I8c87804feef9909cd4697f01ceea0f5504347727
This commit is contained in:
parent
1f52db08ed
commit
e085f1335e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user