mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Send email invitation to invited user
This commit is contained in:
@@ -353,8 +353,9 @@ def test_email_invited_user_should_send_email(notify_api, mocker):
|
||||
invitation['expiry_date'])
|
||||
|
||||
email_invited_user(encryption.encrypt(invitation))
|
||||
|
||||
aws_ses_client.send_email.assert_called_once_with(current_app.config['VERIFY_CODE_FROM_EMAIL_ADDRESS'],
|
||||
email_from = "{}@{}".format(current_app.config['INVITATION_EMAIL_FROM'],
|
||||
current_app.config['NOTIFY_EMAIL_DOMAIN'])
|
||||
aws_ses_client.send_email.assert_called_once_with(email_from,
|
||||
invitation['to'],
|
||||
'Invitation to GOV.UK Notify',
|
||||
expected_content)
|
||||
|
||||
@@ -3,6 +3,7 @@ import uuid
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from app import encryption
|
||||
from tests import create_authorization_header
|
||||
import app.celery.tasks
|
||||
|
||||
@@ -50,11 +51,11 @@ def test_create_invited_user(notify_api, sample_service, mocker):
|
||||
'service_id': str(sample_service.id),
|
||||
'service_name': sample_service.name,
|
||||
'token': 'the-token',
|
||||
'expiry_date': expiry_date
|
||||
'expiry_date': str(expiry_date)
|
||||
}
|
||||
app.celery.tasks.email_invited_user.apply_async.assert_called_once_with(
|
||||
encrypted_invitation=encrypted_invitation,
|
||||
queue_name='email-invited-user')
|
||||
[encryption.encrypt(encrypted_invitation)],
|
||||
queue='email-invited-user')
|
||||
|
||||
|
||||
def test_create_invited_user_invalid_email(notify_api, sample_service, mocker):
|
||||
|
||||
Reference in New Issue
Block a user