diff options
Diffstat (limited to 'tests/models/thl')
| -rw-r--r-- | tests/models/thl/test_adjustments.py | 22 | ||||
| -rw-r--r-- | tests/models/thl/test_payout.py | 2 | ||||
| -rw-r--r-- | tests/models/thl/test_user.py | 8 |
3 files changed, 23 insertions, 9 deletions
diff --git a/tests/models/thl/test_adjustments.py b/tests/models/thl/test_adjustments.py index 30e9bce..96b67d7 100644 --- a/tests/models/thl/test_adjustments.py +++ b/tests/models/thl/test_adjustments.py @@ -60,7 +60,7 @@ class TestSessionAdjustments: ) # Confirm only the last Wall Event is a complete - assert not s1.wall_events[0].status == Status.COMPLETE + assert s1.wall_events[0].status != Status.COMPLETE assert s1.wall_events[1].status == Status.COMPLETE # Confirm the Session is marked as finished and the simple brokerage @@ -532,9 +532,13 @@ class TestAdjustments: w1 = s1.wall_events[0] status, status_code_1 = s1.determine_session_status() - thl_net, commission_amount, bp_pay, user_pay = s1.determine_payments() + _, _, bp_pay, user_pay = s1.determine_payments() s1.update( - status=status, status_code_1=status_code_1, finished=utc_hour_ago + timedelta(minutes=10), payout=bp_pay, user_payout=user_pay + status=status, + status_code_1=status_code_1, + finished=utc_hour_ago + timedelta(minutes=10), + payout=bp_pay, + user_payout=user_pay, ) w1.update( adjusted_status=WallAdjustedStatus.ADJUSTED_TO_FAIL, @@ -586,7 +590,11 @@ class TestAdjustments: thl_net = Decimal(sum(w.cpi for w in s1.wall_events if w.is_visible_complete())) payout = user.product.determine_bp_payment(thl_net=thl_net) s1.update( - status=status, status_code_1=status_code_1, finished=utc_hour_ago + timedelta(minutes=25), payout=payout, user_payout=None + status=status, + status_code_1=status_code_1, + finished=utc_hour_ago + timedelta(minutes=25), + payout=payout, + user_payout=None, ) # Test. Adjust first fail to complete. Now we have 2 completes. @@ -634,7 +642,11 @@ class TestAdjustments: thl_net = Decimal(sum(w.cpi for w in s1.wall_events if w.is_visible_complete())) payout = user.product.determine_bp_payment(thl_net) s1.update( - status=status, status_code_1=status_code_1, finished=utc_hour_ago + timedelta(minutes=25), payout=payout, user_payout=None + status=status, + status_code_1=status_code_1, + finished=utc_hour_ago + timedelta(minutes=25), + payout=payout, + user_payout=None, ) # Test. Adjust complete to fail. Now we have 2 fails. diff --git a/tests/models/thl/test_payout.py b/tests/models/thl/test_payout.py index d0b0acc..f1046cb 100644 --- a/tests/models/thl/test_payout.py +++ b/tests/models/thl/test_payout.py @@ -42,6 +42,8 @@ class TestBusinessPayoutEvent: products=[], bank_accounts=[], ) + assert isinstance(b, Business) + ext_ref_id = uuid4().hex bpe = BusinessPayoutEvent( business_id=uuid4().hex, diff --git a/tests/models/thl/test_user.py b/tests/models/thl/test_user.py index aafce68..e0ba6f8 100644 --- a/tests/models/thl/test_user.py +++ b/tests/models/thl/test_user.py @@ -392,7 +392,7 @@ class TestUserCreated: from generalresearch.models.thl.user import User with pytest.raises(ValueError) as cm: - User(user_id=self.user_id, created=datetime.now(tz=None)) + User(user_id=self.user_id, created=datetime.now(tz=None)) # noqa assert "1 validation error for User" in str(cm.value) assert "Input should have timezone info" in str(cm.value) @@ -401,7 +401,7 @@ class TestUserCreated: user = User(user_id=self.user_id) with pytest.raises(ValueError) as cm: - user.created = datetime.now(tz=None) + user.created = datetime.now(tz=None) # noqa assert "1 validation error for User" in str(cm.value) assert "Input should have timezone info" in str(cm.value) @@ -453,7 +453,7 @@ class TestUserLastSeen: from generalresearch.models.thl.user import User with pytest.raises(ValueError) as cm: - User(user_id=self.user_id, last_seen=datetime.now(tz=None)) + User(user_id=self.user_id, last_seen=datetime.now(tz=None)) # noqa assert "1 validation error for User" in str(cm.value) assert "Input should have timezone info" in str(cm.value) @@ -462,7 +462,7 @@ class TestUserLastSeen: user = User(user_id=self.user_id) with pytest.raises(ValueError) as cm: - user.last_seen = datetime.now(tz=None) + user.last_seen = datetime.now(tz=None) # noqa assert "1 validation error for User" in str(cm.value) assert "Input should have timezone info" in str(cm.value) |
