Working on tests.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2023-12-08 13:15:40 -05:00
parent 5277953761
commit 1fdad3099b
2 changed files with 11 additions and 15 deletions

View File

@@ -1,3 +1,4 @@
from functools import partial
import json
import uuid
@@ -202,9 +203,12 @@ def test_get_invited_user_by_service_when_user_does_not_belong_to_the_service(
assert json_resp["result"] == "error"
def test_resend_expired_invite(client, sample_expired_user):
def test_resend_expired_invite(client, sample_expired_user, mocker):
url = f"/service/{sample_expired_user.service_id}/invite/{sample_expired_user.id}"
# TODO: Don't actually send email, need to mock it out.
mock_send = mocker.patch("app.service_invite.rest.send_notification_to_queue")
mock_persist = mocker.patch("app.service_invite.rest.persist_notification")
from app.notifications.process_notifications import persist_notification
mock_persist.side_effect = partial(persist_notification, simulated=True)
auth_header = create_admin_authorization_header()
response = client.post(
url,