From 23d7092ce1cb63aca5f646e30a110cc9fd3f207d Mon Sep 17 00:00:00 2001 From: Pawan Verma Date: Thu, 12 Dec 2024 15:51:49 +0530 Subject: [PATCH] Fix tests for opportunity stats --- commcare_connect/opportunity/tests/test_models.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/commcare_connect/opportunity/tests/test_models.py b/commcare_connect/opportunity/tests/test_models.py index 3b263a4f..526b83d2 100644 --- a/commcare_connect/opportunity/tests/test_models.py +++ b/commcare_connect/opportunity/tests/test_models.py @@ -69,12 +69,10 @@ def test_opportunity_stats(opportunity: Opportunity, user: User): ocl1 = OpportunityClaimLimitFactory(opportunity_claim=claim, payment_unit=payment_unit1) ocl2 = OpportunityClaimLimitFactory(opportunity_claim=claim, payment_unit=payment_unit2) - assert opportunity.claimed_budget == (ocl1.max_visits * payment_unit1.amount) + ( - ocl2.max_visits * payment_unit2.amount - ) - assert opportunity.remaining_budget == opportunity.total_budget - opportunity.claimed_budget - ( - opportunity.allotted_visits * org_pay + assert opportunity.claimed_budget == (ocl1.max_visits * (payment_unit1.amount + org_pay)) + ( + ocl2.max_visits * (payment_unit2.amount + org_pay) ) + assert opportunity.remaining_budget == opportunity.total_budget - opportunity.claimed_budget @pytest.mark.django_db