aboutsummaryrefslogtreecommitdiff
path: root/test_utils
diff options
context:
space:
mode:
Diffstat (limited to 'test_utils')
-rw-r--r--test_utils/managers/thl/conftest.py31
-rw-r--r--test_utils/models/ledger/conftest.py16
2 files changed, 9 insertions, 38 deletions
diff --git a/test_utils/managers/thl/conftest.py b/test_utils/managers/thl/conftest.py
index 3392559..5b96680 100644
--- a/test_utils/managers/thl/conftest.py
+++ b/test_utils/managers/thl/conftest.py
@@ -23,15 +23,10 @@ if TYPE_CHECKING:
from generalresearch.config import GRLBaseSettings
from generalresearch.managers.thl.buyer import BuyerManager
from generalresearch.managers.thl.category import CategoryManager
- from generalresearch.managers.thl.ipinfo import (
- IPGeonameManager,
- IPInformationManager,
- )
from generalresearch.managers.thl.payout import (
BrokerageProductPayoutEventManager,
BusinessPayoutEventManager,
PayoutEventManager,
- UserPayoutEventManager,
)
from generalresearch.managers.thl.product import ProductManager
from generalresearch.managers.thl.session import SessionManager
@@ -52,6 +47,7 @@ if TYPE_CHECKING:
WallCacheManager,
WallManager,
)
+ from generalresearch.managers.thl.wallet.user_payout import UserPayoutEventManager
# === Msc ===
@@ -139,7 +135,7 @@ def user_payout_event_manager(
assert thl_web_rw.dsn.path
assert "/unittest-" in thl_web_rw.dsn.path
- from generalresearch.managers.thl.payout import UserPayoutEventManager
+ from generalresearch.managers.thl.wallet.user_payout import UserPayoutEventManager
return UserPayoutEventManager(
pg_config=thl_web_rw,
@@ -342,29 +338,6 @@ def surveypenalty_manager(thl_redis_config: RedisConfig):
return SurveyPenaltyManager(redis_config=thl_redis_config)
-# --- IP Geolocation ---
-
-
-@pytest.fixture
-def ip_geoname_manager(thl_web_rw: PostgresConfig) -> IPGeonameManager:
- from generalresearch.managers.thl.ipinfo import IPGeonameManager
-
- return IPGeonameManager(pg_config=thl_web_rw)
-
-
-# --- IP Information ---
-
-
-@pytest.fixture(scope="session")
-def ip_information_manager(thl_web_rw: PostgresConfig) -> IPInformationManager:
- assert thl_web_rw.dsn.path
- assert "/unittest-" in thl_web_rw.dsn.path
-
- from generalresearch.managers.thl.ipinfo import IPInformationManager
-
- return IPInformationManager(pg_config=thl_web_rw)
-
-
# --- IP Record ---
diff --git a/test_utils/models/ledger/conftest.py b/test_utils/models/ledger/conftest.py
index 9ee0df2..e9ddbc9 100644
--- a/test_utils/models/ledger/conftest.py
+++ b/test_utils/models/ledger/conftest.py
@@ -39,7 +39,6 @@ if TYPE_CHECKING:
ThlLedgerManager,
)
from generalresearch.managers.thl.payout import (
- BrokerageProductPayoutEventManager,
BusinessPayoutEventManager,
)
from generalresearch.managers.thl.session import SessionManager
@@ -202,7 +201,7 @@ def bp_payout_event(
@pytest.fixture
def bp_payout_event_factory(
- brokerage_product_payout_event_manager: BrokerageProductPayoutEventManager,
+ business_payout_event_manager: BusinessPayoutEventManager,
thl_ledger_manager: ThlLedgerManager,
) -> Callable[..., BrokerageProductPayoutEvent]:
@@ -210,14 +209,13 @@ def bp_payout_event_factory(
product: Product, usd_cent: USDCent, ext_ref_id: str | None = None
) -> BrokerageProductPayoutEvent:
- return brokerage_product_payout_event_manager.create_bp_payout_event(
+ bus_pe = business_payout_event_manager.create_bp_payout_event(
thl_ledger_manager=thl_ledger_manager,
product=product,
amount=usd_cent,
- ext_ref_id=ext_ref_id,
- skip_wallet_balance_check=True,
- skip_one_per_day_check=True,
+ ext_ref_id=ext_ref_id or uuid4().hex,
)
+ return bus_pe.bp_payouts[0]
return _inner
@@ -225,9 +223,9 @@ def bp_payout_event_factory(
@pytest.fixture
def currency(ledger_manager: LedgerManager) -> LedgerCurrency:
# return request.param if hasattr(request, "currency") else LedgerCurrency.TEST
- assert (
- ledger_manager.currency
- ), "LedgerManager must have a currency specified for these tests"
+ assert ledger_manager.currency, (
+ "LedgerManager must have a currency specified for these tests"
+ )
return ledger_manager.currency