fix UserClientFlask

This commit is contained in:
Cayo Puigdefabregas 2022-04-19 18:39:42 +02:00
parent 25dc0047dc
commit 4a5ad374f8
1 changed files with 21 additions and 3 deletions

View File

@ -254,7 +254,14 @@ class UserClientFlask:
body = next(body).decode("utf-8")
assert "Unassgined" in body
def get(self, uri='', data=None, follow_redirects=True, **kw):
def get(
self,
uri='',
data=None,
follow_redirects=True,
content_type='text/html; charset=utf-8',
**kw,
):
body, status, headers = self.client.get(
uri, data=data, follow_redirects=follow_redirects, headers=self.headers
@ -262,10 +269,21 @@ class UserClientFlask:
body = next(body).decode("utf-8")
return (body, status)
def post(self, uri='', data=None, follow_redirects=True, **kw):
def post(
self,
uri='',
data=None,
follow_redirects=True,
content_type='application/x-www-form-urlencoded',
**kw,
):
body, status, headers = self.client.post(
uri, data=data, follow_redirects=follow_redirects, headers=self.headers
uri,
data=data,
follow_redirects=follow_redirects,
headers=self.headers,
content_type=content_type,
)
body = next(body).decode("utf-8")
return (body, status)