From b17638fbeafffec3357d2bbe4b9baecd9245655a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=8F=AF=E6=B8=85?= <22371433@buaa.edu.cn> Date: Sun, 27 Apr 2025 19:26:22 +0800 Subject: [PATCH] =?UTF-8?q?[fix]:=20=E6=B5=8B=E8=AF=95=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_user.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_user.py b/tests/test_user.py index d4875b1..6c580b0 100644 --- a/tests/test_user.py +++ b/tests/test_user.py @@ -93,6 +93,11 @@ def test_user_case2(): "password": "654321" }) assert login_response.status_code == 200 + + token = login_response.json().get('access_token') + if token is None: + raise ValueError("Failed to get access_token from login response") + Headers = {"Authorization": f"Bearer {token}"} # 还原密码 restore_response = client.post("/user/password", json={ "old_password": "654321",