mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Updated notifications_utils version and associated code. Added email subject formatting for placeholders.
This commit is contained in:
@@ -2,7 +2,7 @@ import json
|
||||
from datetime import datetime
|
||||
|
||||
from flask import url_for
|
||||
from utils.url_safe_token import generate_token
|
||||
from notifications_utils.url_safe_token import generate_token
|
||||
|
||||
|
||||
def test_should_render_new_password_template(app_,
|
||||
|
||||
@@ -76,7 +76,7 @@ def test_verify_email_redirects_to_verify_if_token_valid(app_,
|
||||
mock_check_verify_code):
|
||||
import json
|
||||
token_data = {"user_id": api_user_pending.id, "secret_code": 12345}
|
||||
mocker.patch('utils.url_safe_token.check_token', return_value=json.dumps(token_data))
|
||||
mocker.patch('app.main.views.verify.check_token', return_value=json.dumps(token_data))
|
||||
|
||||
with app_.test_request_context():
|
||||
with app_.test_client() as client:
|
||||
@@ -94,7 +94,7 @@ def test_verify_email_redirects_to_email_sent_if_token_expired(app_,
|
||||
api_user_pending,
|
||||
mock_check_verify_code):
|
||||
from itsdangerous import SignatureExpired
|
||||
mocker.patch('utils.url_safe_token.check_token', side_effect=SignatureExpired('expired'))
|
||||
mocker.patch('app.main.views.verify.check_token', side_effect=SignatureExpired('expired'))
|
||||
|
||||
with app_.test_request_context():
|
||||
with app_.test_client() as client:
|
||||
@@ -114,7 +114,7 @@ def test_verify_email_redirects_to_email_sent_if_token_used(app_,
|
||||
mock_send_verify_code,
|
||||
mock_check_verify_code_code_expired):
|
||||
from itsdangerous import SignatureExpired
|
||||
mocker.patch('utils.url_safe_token.check_token', side_effect=SignatureExpired('expired'))
|
||||
mocker.patch('app.main.views.verify.check_token', side_effect=SignatureExpired('expired'))
|
||||
|
||||
with app_.test_request_context():
|
||||
with app_.test_client() as client:
|
||||
@@ -135,7 +135,7 @@ def test_verify_email_redirects_to_sign_in_if_user_active(app_,
|
||||
mock_check_verify_code):
|
||||
import json
|
||||
token_data = {"user_id": api_user_active.id, "secret_code": 12345}
|
||||
mocker.patch('utils.url_safe_token.check_token', return_value=json.dumps(token_data))
|
||||
mocker.patch('app.main.views.verify.check_token', return_value=json.dumps(token_data))
|
||||
|
||||
with app_.test_request_context():
|
||||
with app_.test_client() as client:
|
||||
|
||||
Reference in New Issue
Block a user