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:
moson-mo 2022-11-24 22:43:31 +01:00
parent 1216399d53
commit a832b3cddb
No known key found for this signature in database
GPG key ID: 4A4760AB4EE15296
10 changed files with 463 additions and 281 deletions

View file

@ -197,7 +197,8 @@ def test_metadata_change(
with client as request:
endp = f"/pkgbase/{pkgbasename}/keywords"
post_data = {"keywords": "abc def"}
resp = request.post(endp, data=post_data, cookies=cookies, allow_redirects=True)
request.cookies = cookies
resp = request.post(endp, data=post_data)
assert resp.status_code == HTTPStatus.OK
# Run main() again, which should now produce a new commit with the