diff --git a/app/dao/invited_user_dao.py b/app/dao/invited_user_dao.py index c045489e8..ad4ab0a65 100644 --- a/app/dao/invited_user_dao.py +++ b/app/dao/invited_user_dao.py @@ -33,7 +33,7 @@ def expire_invitations_created_more_than_two_days_ago(): db.session.query(InvitedUser) .filter( InvitedUser.created_at <= datetime.utcnow() - timedelta(days=2), - InvitedUser.status.in_(INVITE_PENDING), + InvitedUser.status.in_((INVITE_PENDING,)), ) .update({InvitedUser.status: INVITE_EXPIRED}) ) diff --git a/tests/app/service_invite/test_service_invite_rest.py b/tests/app/service_invite/test_service_invite_rest.py index cd499fdb2..fede2596f 100644 --- a/tests/app/service_invite/test_service_invite_rest.py +++ b/tests/app/service_invite/test_service_invite_rest.py @@ -204,7 +204,7 @@ def test_get_invited_user_by_service_when_user_does_not_belong_to_the_service( def test_resend_expired_invite(client, sample_expired_user, mocker): - url = f"/service/{sample_expired_user.service_id}/invite/{sample_expired_user.id}" + url = f"/service/{sample_expired_user.service_id}/invite/{sample_expired_user.id}/resend" 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