mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Revert config changes so it doesn't break local dev builds.
Update tests
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from flask import url_for
|
||||
|
||||
import app
|
||||
|
||||
|
||||
def test_should_render_forgot_password(app_):
|
||||
with app_.test_request_context():
|
||||
@@ -12,8 +14,9 @@ def test_should_render_forgot_password(app_):
|
||||
def test_should_redirect_to_password_reset_sent_for_valid_email(
|
||||
app_,
|
||||
api_user_active,
|
||||
mock_reset_user_password):
|
||||
mocker):
|
||||
with app_.test_request_context():
|
||||
mocker.patch('app.user_api_client.send_reset_password_url', return_value=None)
|
||||
response = app_.test_client().post(
|
||||
url_for('.forgot_password'),
|
||||
data={'email_address': api_user_active.email_address})
|
||||
@@ -21,4 +24,4 @@ def test_should_redirect_to_password_reset_sent_for_valid_email(
|
||||
assert (
|
||||
'You have been sent an email containing a link'
|
||||
' to reset your password.') in response.get_data(as_text=True)
|
||||
mock_reset_user_password.assert_called_once_with(api_user_active.email_address)
|
||||
app.user_api_client.send_reset_password_url.assert_called_once_with(api_user_active.email_address)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from flask import url_for
|
||||
from tests.conftest import SERVICE_ONE_ID
|
||||
|
||||
|
||||
def test_should_render_two_factor_page(app_,
|
||||
@@ -31,11 +32,10 @@ def test_should_login_user_and_redirect_to_service_dashboard(app_,
|
||||
'email': api_user_active.email_address}
|
||||
response = client.post(url_for('main.two_factor'),
|
||||
data={'sms_code': '12345'})
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == url_for(
|
||||
'main.service_dashboard',
|
||||
service_id="596364a0-858e-42c8-9062-a8fe822260eb",
|
||||
service_id=SERVICE_ONE_ID,
|
||||
_external=True
|
||||
)
|
||||
|
||||
@@ -125,11 +125,10 @@ def test_two_factor_should_set_password_when_new_password_exists_in_session(app_
|
||||
|
||||
response = client.post(url_for('main.two_factor'),
|
||||
data={'sms_code': '12345'})
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == url_for(
|
||||
'main.service_dashboard',
|
||||
service_id="596364a0-858e-42c8-9062-a8fe822260eb",
|
||||
service_id=SERVICE_ONE_ID,
|
||||
_external=True
|
||||
)
|
||||
api_user_active.password = 'changedpassword'
|
||||
|
||||
Reference in New Issue
Block a user