add new template to config

and rename existing new user email verification template for clarity
This commit is contained in:
Leo Hemsted
2017-11-03 14:38:30 +00:00
parent 57b7a392b2
commit dd326ec1d3
4 changed files with 12 additions and 11 deletions

View File

@@ -871,7 +871,7 @@ def email_verification_template(notify_db,
return create_custom_template(
service=service,
user=user,
template_config_name='EMAIL_VERIFY_CODE_TEMPLATE_ID',
template_config_name='NEW_USER_EMAIL_VERIFICATION_TEMPLATE_ID',
content='((user_name)) use ((url)) to complete registration',
template_type='email'
)

View File

@@ -261,14 +261,14 @@ def test_send_sms_code_returns_204_when_too_many_codes_already_created(client, s
assert VerifyCode.query.count() == 10
def test_send_user_email_verification(client,
sample_user,
mocker,
email_verification_template):
def test_send_new_user_email_verification(client,
sample_user,
mocker,
email_verification_template):
mocked = mocker.patch('app.celery.provider_tasks.deliver_email.apply_async')
auth_header = create_authorization_header()
resp = client.post(
url_for('user.send_user_email_verification', user_id=str(sample_user.id)),
url_for('user.send_new_user_email_verification', user_id=str(sample_user.id)),
data=json.dumps({}),
headers=[('Content-Type', 'application/json'), auth_header])
assert resp.status_code == 204
@@ -284,7 +284,7 @@ def test_send_email_verification_returns_404_for_bad_input_data(client, notify_d
uuid_ = uuid.uuid4()
auth_header = create_authorization_header()
resp = client.post(
url_for('user.send_user_email_verification', user_id=uuid_),
url_for('user.send_new_user_email_verification', user_id=uuid_),
data=json.dumps({}),
headers=[('Content-Type', 'application/json'), auth_header])
assert resp.status_code == 404