summaryrefslogtreecommitdiff
path: root/openstack_dashboard
diff options
context:
space:
mode:
authorAkihiro Motoki <amotoki@gmail.com>2021-02-24 23:45:45 +0900
committerVishal Manchanda <manchandavishal143@gmail.com>2021-09-15 18:15:04 +0000
commite77633c56a0bcc196f5ccaf28693cef14a6d980a (patch)
treea9d36a2cdf021aafeaca83e6be8fd2793d6ef2df /openstack_dashboard
parent44b7c03fbab93cab768f03e0ea8a517a34bf6053 (diff)
downloadhorizon-e77633c56a0bcc196f5ccaf28693cef14a6d980a.tar.gz
Support Django 3.2 support (1)
Django 3.2 defines the new header API for the response object [1]. This change dropped "_headers" attribute from the response object. Instead of accesing a private attribute, we need to use the public APIs for response headers [2]. [1] https://docs.djangoproject.com/en/3.2/releases/3.2/#requests-and-responses [2] https://docs.djangoproject.com/en/3.2/ref/request-response/#httpresponse-objects Change-Id: Ia13212fd231215e17f4bba2039e79874b676e634
Diffstat (limited to 'openstack_dashboard')
-rw-r--r--openstack_dashboard/test/helpers.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/openstack_dashboard/test/helpers.py b/openstack_dashboard/test/helpers.py
index b4a561bd5..6d2292673 100644
--- a/openstack_dashboard/test/helpers.py
+++ b/openstack_dashboard/test/helpers.py
@@ -279,7 +279,10 @@ class TestCase(horizon_helpers.TestCase):
Asserts that the given response issued a 302 redirect without
processing the view which is redirected to.
"""
- 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)