diff options
| author | stuppie | 2026-10-12 16:59:03 -0700 |
|---|---|---|
| committer | stuppie | 2026-10-12 16:59:03 -0700 |
| commit | 1746411f8dd0b880b3d069afc0b008a176fd811a (patch) | |
| tree | 069e422f1914e70b5d15bee2057bb7c04bcc38dc /tests/managers/thl/test_ledger/test_thl_pem.py | |
| parent | c975021688d2c195f8d585ebd919b9cbdacb09ad (diff) | |
| download | generalresearch-1746411f8dd0b880b3d069afc0b008a176fd811a.tar.gz generalresearch-1746411f8dd0b880b3d069afc0b008a176fd811a.zip | |
BusinessCreate model. Remove payouts from Product (query for me). Pagination and ordering of business and product payouts
Diffstat (limited to 'tests/managers/thl/test_ledger/test_thl_pem.py')
| -rw-r--r-- | tests/managers/thl/test_ledger/test_thl_pem.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/managers/thl/test_ledger/test_thl_pem.py b/tests/managers/thl/test_ledger/test_thl_pem.py index 348a02d..ddf9bc9 100644 --- a/tests/managers/thl/test_ledger/test_thl_pem.py +++ b/tests/managers/thl/test_ledger/test_thl_pem.py @@ -69,13 +69,25 @@ class TestThlPayoutEventManager: accounts = thl_ledger_manager.get_accounts_bp_wallet_for_products( product_uuids=[i.uuid for i in products] ) - res = brokerage_product_payout_event_manager.filter_by( + res, count = brokerage_product_payout_event_manager.filter_by( debit_account_uuids=[i.uuid for i in accounts] ) assert len(res) == (N_PRODUCTS * N_PAYOUT_EVENTS) + assert count == len(res) assert sum([i.amount for i in res]) == sum(amounts) + page, count = brokerage_product_payout_event_manager.filter_by( + debit_account_uuids=[i.uuid for i in accounts], + page=1, + size=2, + order_field="created", + descending=True, + ) + assert len(page) == 2 + assert count == (N_PRODUCTS * N_PAYOUT_EVENTS) + assert page == sorted(page, key=lambda payout: payout.created, reverse=True) + def test_get_bp_payout_events_for_product( self, product_factory: Callable[..., Product], |
