fix(douyu): coordinate collab and platform account leases

Avoid automatic allocation of accounts with active external collaboration, require explicit manual takeover of platform leases, and add Douyu account identity search.
This commit is contained in:
yml
2026-11-20 00:18:28 +08:00
parent d19809b4ca
commit 85837944d0
12 changed files with 704 additions and 59 deletions
+8 -6
View File
@@ -43,7 +43,7 @@ def test_active_payment_blocks_same_account_across_users(db):
owner.id,
)
with pytest.raises(DouyuActivePaymentError, match=first_batch):
with pytest.raises(DouyuActivePaymentError) as exc_info:
create_douyu_planned_tasks(
db,
[account.id],
@@ -52,11 +52,13 @@ def test_active_payment_blocks_same_account_across_users(db):
other.id,
)
task = (
db.query(DouyuTask)
.filter(DouyuTask.batch_id == first_batch)
.one()
)
message = str(exc_info.value)
assert first_batch in message
assert "开通精英宝典" in message
assert "已创建,等待执行" in message
assert "二维码或支付会话串单" in message
task = db.query(DouyuTask).filter(DouyuTask.batch_id == first_batch).one()
task.status = "stopped"
db.commit()