From b389826dac400218ba412a6dce4303c1c0a4964b Mon Sep 17 00:00:00 2001 From: Pawan Verma Date: Tue, 29 Oct 2024 15:27:41 +0530 Subject: [PATCH] Add ManagedOpportunity in fixture --- commcare_connect/conftest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commcare_connect/conftest.py b/commcare_connect/conftest.py index 415a6bba..c984262b 100644 --- a/commcare_connect/conftest.py +++ b/commcare_connect/conftest.py @@ -10,6 +10,7 @@ PaymentUnitFactory, ) from commcare_connect.organization.models import Organization +from commcare_connect.program.tests.factories import ManagedOpportunityFactory from commcare_connect.users.models import User from commcare_connect.users.tests.factories import ( ConnectIdUserLinkFactory, @@ -52,7 +53,10 @@ def opportunity(request): verification_flags = getattr(request, "param", {}).get("verification_flags", {}) opp_options = {"is_test": False} opp_options.update(getattr(request, "param", {}).get("opp_options", {})) - factory = OpportunityFactory(**opp_options) + if opp_options.get("managed", False): + factory = ManagedOpportunityFactory(**opp_options) + else: + factory = OpportunityFactory(**opp_options) OpportunityVerificationFlagsFactory(opportunity=factory, **verification_flags) return factory