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
|
@ -99,7 +99,8 @@ def test_user_language(client: TestClient, user: User):
|
|||
assert sid is not None
|
||||
|
||||
with client as req:
|
||||
response = req.post("/language", data=post_data, cookies={"AURSID": sid})
|
||||
req.cookies = {"AURSID": sid}
|
||||
response = req.post("/language", data=post_data)
|
||||
assert response.status_code == int(HTTPStatus.SEE_OTHER)
|
||||
assert user.LangPreference == "de"
|
||||
|
||||
|
@ -154,6 +155,5 @@ def test_id_redirect(client: TestClient):
|
|||
"key": "value", # Test that this param persists.
|
||||
"key2": "value2", # And this one.
|
||||
},
|
||||
allow_redirects=False,
|
||||
)
|
||||
assert response.headers.get("location") == "/test?key=value&key2=value2"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue