Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
pxwxnvermx committed Oct 25, 2023
1 parent fcc1997 commit d5bea57
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion commcare_connect/opportunity/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@

class TestConnectUserCreation:
@pytest.mark.django_db
def test_add_connect_user(self):
def test_add_connect_user(self, httpx_mock):
opportunity = OpportunityFactory()
with (
mock.patch("commcare_connect.opportunity.tasks.fetch_users") as fetch_users,
mock.patch("commcare_connect.users.helpers.send_sms"),
):
httpx_mock.add_response(
method="POST",
json={
"all_success": True,
"responses": [
{"username": "test", "status": "success"},
{"username": "test2", "status": "success"},
],
},
)
fetch_users.return_value = [
ConnectIdUser(username="test", phone_number="+15555555555", name="a"),
ConnectIdUser(username="test2", phone_number="+12222222222", name="b"),
Expand Down

0 comments on commit d5bea57

Please sign in to comment.