diff options
| author | Max Nanis | 2026-09-02 18:29:22 -0700 |
|---|---|---|
| committer | Max Nanis | 2026-09-02 18:29:22 -0700 |
| commit | 4a4e5293777aa0fe5fb5bee4e61b1c6f735b4c13 (patch) | |
| tree | 28b8e469900e920286ff7dc2b5124cb83c0def2f /test_utils/models | |
| parent | fe531d691d75193619d43abf22d22599171539fd (diff) | |
| download | generalresearch-4a4e5293777aa0fe5fb5bee4e61b1c6f735b4c13.tar.gz generalresearch-4a4e5293777aa0fe5fb5bee4e61b1c6f735b4c13.zip | |
WIP tests/models/gr
Diffstat (limited to 'test_utils/models')
| -rw-r--r-- | test_utils/models/thl/conftest.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test_utils/models/thl/conftest.py b/test_utils/models/thl/conftest.py index badd87c..5826f0d 100644 --- a/test_utils/models/thl/conftest.py +++ b/test_utils/models/thl/conftest.py @@ -39,6 +39,7 @@ if TYPE_CHECKING: from generalresearch.managers.thl.userhealth import AuditLogManager, IPRecordManager from generalresearch.managers.thl.wall import WallManager from generalresearch.models.definitions import DeviceType + from generalresearch.models.gr.business import Business from generalresearch.models.gr.team import Team from generalresearch.models.legacy.bucket import Bucket from generalresearch.models.thl.ipinfo import IPGeoname, IPInformation @@ -154,8 +155,7 @@ def product_factory(product_manager: ProductManager) -> Callable[..., Product]: def _inner( save: bool = True, team: Team | None = None, - # business: Business | None = None, - # commission_pct: Decimal = Decimal("0.05"), + business: Business | None = None, product_id: UUIDStr | None = None, business_id: UUIDStr | None = None, name: str | None = None, @@ -171,8 +171,12 @@ def product_factory(product_manager: ProductManager) -> Callable[..., Product]: user_health_config: UserHealthConfig | None = None, ) -> Product: """To be used in tests, where we don't care about certain fields""" + product_id = product_id if product_id else uuid4().hex + team_id = team.uuid if team else uuid4().hex + business_id = business.uuid if business else uuid4().hex + name = name if name else f"name-{product_id[:12]}" redirect_url = redirect_url if redirect_url else "https://www.example.com/" |
