Fix Telegram bot deploy receiver cleanup

This commit is contained in:
2569718930@qq.com
2026-06-26 21:16:17 +08:00
parent 1d11a5cbc6
commit d7ab68182e
3 changed files with 39 additions and 2 deletions
+11 -1
View File
@@ -185,11 +185,21 @@ def test_bindtopic_rejects_non_admin(monkeypatch):
assert "管理员" in bot.replies[0]["text"]
def test_start_bind_token_binds_telegram_to_web_account():
def test_start_bind_token_binds_telegram_to_web_account(monkeypatch):
import src.bot.handlers.basic as basic
bot = DummyBot()
consumed = []
bound = []
monkeypatch.setattr(
basic,
"TelegramGroupPricing",
lambda *_args, **_kwargs: (_ for _ in ()).throw(
AssertionError("web bind tokens must not require Telegram group membership")
),
)
def _consume(token):
consumed.append(token)
return {