mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add support for Accept-Language in HTTP test class
"Accept-Language" is used to test translations. Fixes: https://pagure.io/freeipa/issue/7559 Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
committed by
Rob Crittenden
parent
0dace623ab
commit
0908e80d62
@@ -33,6 +33,7 @@ class Unauthorized_HTTP_test(object):
|
||||
host = api.env.host
|
||||
cacert = api.env.tls_ca_cert
|
||||
content_type = 'application/x-www-form-urlencoded'
|
||||
accept_language = 'en-us'
|
||||
|
||||
def send_request(self, method='POST', params=None):
|
||||
"""
|
||||
@@ -47,8 +48,9 @@ class Unauthorized_HTTP_test(object):
|
||||
params = urllib.parse.urlencode(params, True)
|
||||
url = 'https://' + self.host + self.app_uri
|
||||
|
||||
headers = {'Content-Type' : self.content_type,
|
||||
'Referer' : url}
|
||||
headers = {'Content-Type': self.content_type,
|
||||
'Accept-Language': self.accept_language,
|
||||
'Referer': url}
|
||||
|
||||
conn = util.create_https_connection(
|
||||
self.host, cafile=self.cacert)
|
||||
|
||||
Reference in New Issue
Block a user