diff options
| author | Greg Stupp | 2026-10-13 15:53:56 +0000 |
|---|---|---|
| committer | Greg Stupp | 2026-10-13 15:53:56 +0000 |
| commit | c265cc29d7a864651377c94be8695c9cf9b79bf1 (patch) | |
| tree | ad6fae9db1762ab83a373a71f67e9a796ac6726a /tests/managers/thl/test_ledger/test_thl_pem.py | |
| parent | c975021688d2c195f8d585ebd919b9cbdacb09ad (diff) | |
| parent | c53c0f938684bbc98b7cccac2d886a6926b6e7f2 (diff) | |
| download | generalresearch-3.8.0.tar.gz generalresearch-3.8.0.zip | |
Merges pull request #9
v3.8.0
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], |
