diff options
Diffstat (limited to 'tests/managers')
| -rw-r--r-- | tests/managers/thl/test_payout.py | 12 | ||||
| -rw-r--r-- | tests/managers/thl/test_wallet/test_user_payout.py | 6 |
2 files changed, 10 insertions, 8 deletions
diff --git a/tests/managers/thl/test_payout.py b/tests/managers/thl/test_payout.py index be121d8..d5cc9e3 100644 --- a/tests/managers/thl/test_payout.py +++ b/tests/managers/thl/test_payout.py @@ -189,6 +189,7 @@ class TestPayout: thl_ledger_manager: ThlLedgerManager, product: Product, user: User, + user_factory, user_payout_event_manager: UserPayoutEventManager, utc_now: datetime, ): @@ -196,7 +197,8 @@ class TestPayout: from generalresearch.models.thl.wallet.definitions import PayoutType user_account = thl_ledger_manager.get_account_or_create_user_wallet(user=user) - bp_account = thl_ledger_manager.get_account_or_create_bp_wallet(product=product) + user2 = user_factory(product=user.product) + user_account2 = thl_ledger_manager.get_account_or_create_user_wallet(user=user2) user_payout_event_manager.create( status=PayoutStatus.PENDING, @@ -209,7 +211,7 @@ class TestPayout: user_payout_event_manager.create( status=PayoutStatus.PENDING, - debit_account_uuid=bp_account.uuid, + debit_account_uuid=user_account2.uuid, payout_type=PayoutType.PAYPAL, cashout_method_uuid=cashout_method_uuid, amount=200, @@ -222,12 +224,12 @@ class TestPayout: assert 1 == len(pes) pes = user_payout_event_manager.filter_by( - debit_account_uuids=[bp_account.uuid], created=utc_now + debit_account_uuids=[user_account2.uuid], created=utc_now ) assert 1 == len(pes) pes = user_payout_event_manager.filter_by( - debit_account_uuids=[bp_account.uuid], amount=123 + debit_account_uuids=[user_account2.uuid], amount=123 ) assert 0 == len(pes) @@ -237,7 +239,7 @@ class TestPayout: assert 0 == len(pes) pes = user_payout_event_manager.filter_by(product_ids=[user.product_id]) - assert 1 == len(pes) + assert 2 == len(pes) pes = user_payout_event_manager.filter_by( cashout_types=[PayoutType.PAYPAL], diff --git a/tests/managers/thl/test_wallet/test_user_payout.py b/tests/managers/thl/test_wallet/test_user_payout.py index bbc97a3..2a89c97 100644 --- a/tests/managers/thl/test_wallet/test_user_payout.py +++ b/tests/managers/thl/test_wallet/test_user_payout.py @@ -23,7 +23,7 @@ from generalresearch.models.thl.user import User from generalresearch.models.thl.wallet.cashout_method import ( CashMailCashoutMethodData, CashMailCashoutMethodRequestData, - CashoutRequestInfo, + CashoutRequestDetail, PaypalCashoutMethodData, PaypalCashoutMethodRequestData, USDeliveryAddress, @@ -103,7 +103,7 @@ class TestUserPayoutEventManager: ) res = user_payout_event_manager.get_payout_detail(pe_uuid=pe.uuid) - assert isinstance(res, CashoutRequestInfo) + assert isinstance(res, CashoutRequestDetail) def test_get_payout_detail_paypal( self, @@ -129,7 +129,7 @@ class TestUserPayoutEventManager: ) res = user_payout_event_manager.get_payout_detail(pe_uuid=pe.uuid) - assert isinstance(res, CashoutRequestInfo) + assert isinstance(res, CashoutRequestDetail) class TestUserRequestRedeem: |
