mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(test): FastAPI 0.87.0 - warning fixes
FastAPI 0.87.0 switched to the httpx library for their TestClient * cookies need to be defined on the request instance instead of method calls Signed-off-by: moson-mo <mo-son@mailbox.org>
This commit is contained in:
parent
1216399d53
commit
a832b3cddb
10 changed files with 463 additions and 281 deletions
|
@ -210,7 +210,8 @@ def test_homepage_dashboard(redis, packages, user):
|
|||
|
||||
cookies = {"AURSID": user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
response = request.get("/", cookies=cookies)
|
||||
request.cookies = cookies
|
||||
response = request.get("/")
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
root = parse_root(response.text)
|
||||
|
@ -307,7 +308,8 @@ def test_homepage_dashboard_flagged(user: User, user2: User, package: Package):
|
|||
# flagged maintained packages.
|
||||
cookies = {"AURSID": user.login(Request(), "testPassword")}
|
||||
with client as request:
|
||||
resp = request.get("/", cookies=cookies)
|
||||
request.cookies = cookies
|
||||
resp = request.get("/")
|
||||
assert resp.status_code == int(HTTPStatus.OK)
|
||||
|
||||
root = parse_root(resp.text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue