diff options
| author | Greg Stupp | 2026-09-08 17:43:00 +0000 |
|---|---|---|
| committer | Greg Stupp | 2026-09-08 17:43:00 +0000 |
| commit | a65c38241f9b27abac166afb050b1ec846e5561d (patch) | |
| tree | e25cd8ec5ac74b301f0282ed5a6a359f3450c112 /test_utils/models | |
| parent | 8896faf529f634985a0eb6e1ae77e4ebf7ab4ba0 (diff) | |
| parent | 70e2024b3b8abdf3965f59545aa35fda6270de1d (diff) | |
| download | generalresearch-2fc5876ece4b70b8a6cadbf193ddb179f6439d73.tar.gz generalresearch-2fc5876ece4b70b8a6cadbf193ddb179f6439d73.zip | |
Merges pull request #3
v3.4.6
Dev greg
Diffstat (limited to 'test_utils/models')
| -rw-r--r-- | test_utils/models/conftest.py | 16 | ||||
| -rw-r--r-- | test_utils/models/thl/conftest.py | 8 |
2 files changed, 24 insertions, 0 deletions
diff --git a/test_utils/models/conftest.py b/test_utils/models/conftest.py index ffce272..7f82f69 100644 --- a/test_utils/models/conftest.py +++ b/test_utils/models/conftest.py @@ -1,6 +1,7 @@ from __future__ import annotations from collections.abc import Callable +from decimal import Decimal from typing import TYPE_CHECKING from uuid import uuid4 @@ -76,6 +77,21 @@ def product_amt_true( ) +@pytest.fixture +def product_failed_attempt_credit( + product_factory: Callable[..., Product], + payout_config: PayoutConfig, +) -> Product: + from generalresearch.models.thl.product import UserWalletConfig + + return product_factory( + user_wallet_config=UserWalletConfig( + enabled=True, failed_attempt_credit=Decimal("0.05") + ), + payout_config=payout_config, + ) + + @pytest.fixture(scope="session") def buyer(buyer_manager: BuyerManager) -> Buyer: buyer_code = uuid4().hex diff --git a/test_utils/models/thl/conftest.py b/test_utils/models/thl/conftest.py index e09eadd..d20fdc4 100644 --- a/test_utils/models/thl/conftest.py +++ b/test_utils/models/thl/conftest.py @@ -700,6 +700,14 @@ def user_with_wallet_amt( return user_factory(save=True, product=product_amt_true) +@pytest.fixture +def user_failed_attempt_credit( + user_factory: Callable[..., User], product_failed_attempt_credit: Product +) -> User: + # A user on a product with user wallet enabled, failed_attempt_credit enabled + return user_factory(save=True, product=product_failed_attempt_credit) + + # --- User Payout Event --- |
