test: relax hardcoded execute count, add telegram_id conflict assertion

- Change == 17 to >= 17 so test doesn't break on new bulk updates
- Assert secondary.telegram_id is None in conflict test
This commit is contained in:
Fringg
2026-03-04 15:46:51 +03:00
parent 0e8c61a776
commit 8ee97ba1ba
+5 -3
View File
@@ -377,6 +377,8 @@ class TestExecuteMergeTelegramTransfer:
result = await execute_merge(db, 1, 2)
assert result.telegram_id == 11111
# Secondary's telegram_id cleared during cleanup (unique constraint)
assert secondary.telegram_id is None
class TestExecuteMergeEmailTransfer:
@@ -723,9 +725,9 @@ class TestExecuteMergeBulkUpdates:
with _patch_remnawave_delete():
await execute_merge(db, 1, 2)
# Transaction + 10 payment models + 1 cross-referral DELETE + 2 referral_earnings
# + 1 referral chain + 1 withdrawal_requests + 1 refresh tokens = 17 total execute calls
assert db.execute.await_count == 17
# Minimum: Transaction(1) + payment models(10) + cross-referral DELETE(1)
# + referral_earnings(2) + referral chain(1) + withdrawal_requests(1) + refresh tokens(1) = 17
assert db.execute.await_count >= 17
# ---------------------------------------------------------------------------