aboutsummaryrefslogtreecommitdiff
path: root/tests/models/test_finance.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/models/test_finance.py')
-rw-r--r--tests/models/test_finance.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/models/test_finance.py b/tests/models/test_finance.py
index a1da961..53df014 100644
--- a/tests/models/test_finance.py
+++ b/tests/models/test_finance.py
@@ -2,6 +2,7 @@ from __future__ import annotations
from collections.abc import Callable
from datetime import UTC, datetime, timedelta
+from decimal import Decimal
from itertools import product as iter_product
from random import randint
from typing import TYPE_CHECKING
@@ -839,16 +840,22 @@ class TestBusinessBalanceData:
delete_df_collection(coll=ledger_collection)
rm_ledger_collection()
+ # We're expecting 5 time periods x 5 $.50 complete (minus 5% commission = $0.48)
+ # = $12.00
for _ in range(5):
u: User = user_factory(product=product, created=ledger_collection.start)
for item in ledger_collection.items:
+ # A time may be randomly outside the date range, as the
+ # session_with_tx_factory adds time to each wall event it creates
item_time = fake.date_time_between(
start_date=item.start,
- end_date=item.finish,
+ end_date=item.finish - timedelta(minutes=10),
tzinfo=UTC,
)
- session_with_tx_factory(started=item_time, user=u)
+ session_with_tx_factory(
+ started=item_time, user=u, wall_req_cpi=Decimal("0.50")
+ )
item.initial_load(overwrite=True)
# Confirm any of the items are archived