Skip to content

Commit

Permalink
Add ManagedOpportunity in fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
pxwxnvermx committed Oct 29, 2024
1 parent 0f7c83f commit b389826
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion commcare_connect/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b389826

Please sign in to comment.