Skip to content

Commit

Permalink
Fix test for updated counts
Browse files Browse the repository at this point in the history
  • Loading branch information
pxwxnvermx committed Nov 15, 2024
1 parent e4a3299 commit 30f4edd
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import random
from copy import deepcopy
from uuid import uuid4

Expand Down Expand Up @@ -176,6 +177,8 @@ def test_receiver_deliver_form_max_visits_reached(
def submit_form_for_random_entity(form_json):
duplicate_json = deepcopy(form_json)
duplicate_json["form"]["deliver"]["entity_id"] = str(uuid4())
# generate random locations for form submissions
duplicate_json["metadata"]["location"] = " ".join([str(random.uniform(10, 100)) for _ in range(4)])
make_request(api_client, duplicate_json, mobile_user_with_connect_link)

payment_units = opportunity.paymentunit_set.all()
Expand All @@ -190,7 +193,7 @@ def submit_form_for_random_entity(form_json):
user_visits = UserVisit.objects.filter(user=mobile_user_with_connect_link)
assert user_visits.count() == 5
# First four are not over-limit
assert {u.status for u in user_visits[0:4]} == {VisitValidationStatus.pending, VisitValidationStatus.approved}
assert {u.status for u in user_visits[0:4]} == {VisitValidationStatus.approved}
# Last one is over limit
assert user_visits[4].status == VisitValidationStatus.over_limit

Expand Down

0 comments on commit 30f4edd

Please sign in to comment.