diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 58e2678e..b197c38a 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -277,12 +277,12 @@ class TestmintWallet: logger.info(f"TestmintWallet.credit_balance amount in msat: {amount_msat}") # Credit the balance using atomic database update to prevent race conditions - from sqlmodel import update + from sqlmodel import col, update # Use atomic update to avoid lost update problem in concurrent scenarios stmt = ( update(ApiKey) - .where(ApiKey.hashed_key == key.hashed_key) + .where(col(ApiKey.hashed_key) == key.hashed_key) .values(balance=ApiKey.balance + amount_msat) ) await session.execute(stmt)