diff options
| author | Greg Stupp | 2026-09-18 22:39:18 +0000 |
|---|---|---|
| committer | Greg Stupp | 2026-09-18 22:39:18 +0000 |
| commit | b373b992cae3a9628a9cf64387c7b8e286d6e1e0 (patch) | |
| tree | 5e21759ea2c6925e8f54328fbbac88b6be007648 /tests/managers/thl/test_ledger/test_thl_lm_tx.py | |
| parent | 32f30b5ddc600e22e071f7659f1872a18ebf42c7 (diff) | |
| parent | e3c6a824f4176402e40217c5ce70f837dedc5c3d (diff) | |
| download | generalresearch-b373b992cae3a9628a9cf64387c7b8e286d6e1e0.tar.gz generalresearch-b373b992cae3a9628a9cf64387c7b8e286d6e1e0.zip | |
Merges pull request #4
v3.5.0
User Cashout Stuff pulled out of grpc, user ip history enrichments with grip (no maxmind)
Diffstat (limited to 'tests/managers/thl/test_ledger/test_thl_lm_tx.py')
| -rw-r--r-- | tests/managers/thl/test_ledger/test_thl_lm_tx.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/managers/thl/test_ledger/test_thl_lm_tx.py b/tests/managers/thl/test_ledger/test_thl_lm_tx.py index 96ea0d6..22a7b73 100644 --- a/tests/managers/thl/test_ledger/test_thl_lm_tx.py +++ b/tests/managers/thl/test_ledger/test_thl_lm_tx.py @@ -806,6 +806,24 @@ class TestThlLedgerTxManager: assert thl_ledger_manager.get_session_attempt_credit(session.uuid) == 5 assert thl_ledger_manager.get_user_attempt_credit_balance(user) == 5 + attempt_credit_account = ( + thl_ledger_manager.get_account_or_create_user_attempt_credit(user) + ) + user_txs = thl_ledger_manager.get_user_txs( + user, account_uuid=attempt_credit_account.uuid + ) + assert user_txs.total == 1 + assert user_txs.transactions[0].tx_type == TransactionType.USER_ATTEMPT_CREDIT + assert user_txs.transactions[0].amount == 5 + assert user_txs.transactions[0].balance_after == 5 + assert user_txs.summary.user_attempt_credit.entry_count == 1 + assert user_txs.summary.user_attempt_credit.total_amount == 5 + + user_txs_by_name = thl_ledger_manager.get_user_txs( + user, qualified_name=attempt_credit_account.qualified_name + ) + assert user_txs_by_name == user_txs + with pytest.raises( LedgerTransactionConditionFailedError, match=r"^duplicate tag$" ): @@ -887,6 +905,15 @@ class TestThlLedgerTxManager: assert thl_ledger_manager.get_user_wallet_balance(user) == round(user_pay * 100) assert thl_ledger_manager.check_ledger_balanced() + attempt_credit_account = ( + thl_ledger_manager.get_account_or_create_user_attempt_credit(user) + ) + user_txs = thl_ledger_manager.get_user_txs( + user, account_uuid=attempt_credit_account.uuid + ) + assert [tx.amount for tx in user_txs.transactions] == [5, -5] + assert [tx.balance_after for tx in user_txs.transactions] == [5, 0] + def test_bp_payment_with_zero_attempt_credit_balance( self, session_factory: Callable[..., Session], |
