From d872755bb87565d85309bbe836f23275e25a6d94 Mon Sep 17 00:00:00 2001 From: guke Date: Thu, 23 Jul 2026 18:28:51 +0800 Subject: [PATCH] =?UTF-8?q?test(withdraw):=20=E6=B5=8B=E8=AF=95=E5=81=A5?= =?UTF-8?q?=E5=A3=AE=E6=80=A7=20polish(openid=20=E5=8F=96=E8=87=AA=20User?= =?UTF-8?q?=20+=20=E8=A1=A5=20status=5Fcode=20=E6=96=AD=E8=A8=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_withdraw.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_withdraw.py b/tests/test_withdraw.py index 509fb0a..ac395a4 100644 --- a/tests/test_withdraw.py +++ b/tests/test_withdraw.py @@ -438,7 +438,7 @@ def _seed_transfer_auth(phone: str, state: str, authorization_id: str | None) -> auth = db.get(WechatTransferAuthorization, user.id) if auth is None: auth = WechatTransferAuthorization( - user_id=user.id, openid="openid_test_abc", + user_id=user.id, openid=user.wechat_openid or "openid_test_abc", out_authorization_no=f"oan_{user.id}", ) db.add(auth) @@ -465,6 +465,7 @@ def test_withdraw_info_auth_enabled_requires_authorization_id(client, monkeypatc # active 且有 authorization_id → 已授权 _seed_transfer_auth("13800002051", "active", "wx_auth_123") r = client.get("/api/v1/wallet/withdraw-info", headers=_auth(token)) + assert r.status_code == 200, r.text assert r.json()["transfer_auth_enabled"] is True @@ -482,4 +483,5 @@ def test_transfer_auth_status_requires_authorization_id(client, monkeypatch) -> _seed_transfer_auth("13800002052", "active", "wx_auth_456") r = client.get("/api/v1/wallet/transfer-auth/status", headers=_auth(token)) + assert r.status_code == 200, r.text assert r.json()["enabled"] is True