Fix test cases for compatibility with httpx 0.28.0.

This commit is contained in:
2024-12-02 08:09:17 +08:00
parent e00c14f277
commit 40278eaf06
3 changed files with 16 additions and 10 deletions

View File

@@ -96,7 +96,9 @@ def get_client(app: Flask, username: str) -> httpx.Client:
:param username: The username.
:return: The user client.
"""
client: httpx.Client = httpx.Client(app=app, base_url=TEST_SERVER)
client: httpx.Client = httpx.Client(
transport=httpx.WSGITransport(app=app),
base_url=TEST_SERVER)
client.headers["Referer"] = TEST_SERVER
csrf_token: str = get_csrf_token(client)
with app.app_context():