Revert "Stop automatically resending email verification links"

This commit is contained in:
Katie Smith
2019-01-21 15:44:15 +00:00
committed by GitHub
parent 061235958e
commit 398aef6d4c
4 changed files with 32 additions and 30 deletions

View File

@@ -235,8 +235,11 @@ def test_two_factor_email_link_has_expired(
assert response.status_code == 200
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert page.h1.text.strip() == 'The link has expired'
mock_send_verify_code.assert_not_called
assert normalize_spaces(
page.select_one('.banner-dangerous').text
) == "The link in the email we sent you has expired. Weve sent you a new one."
assert page.h1.text.strip() == 'Email resent'
mock_send_verify_code.assert_called_once_with(fake_uuid, 'email', None)
def test_two_factor_email_link_is_invalid(
@@ -269,11 +272,11 @@ def test_two_factor_email_link_is_already_used(
)
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert normalize_spaces(
page.select_one('.banner-dangerous').text
) == "This link has already been used"
assert response.status_code == 200
assert page.h1.text.strip() == 'The link has expired'
mock_send_verify_code.assert_not_called
def test_two_factor_email_link_when_user_is_locked_out(
client,
@@ -289,11 +292,11 @@ def test_two_factor_email_link_when_user_is_locked_out(
)
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert normalize_spaces(
page.select_one('.banner-dangerous').text
) == "This link has already been used"
assert response.status_code == 200
assert page.h1.text.strip() == 'The link has expired'
mock_send_verify_code.assert_not_called
def test_two_factor_email_link_used_when_user_already_logged_in(
logged_in_client,