mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Working tests, hopefully all code changes done.
This commit is contained in:
@@ -3,7 +3,7 @@ from app.main.dao import users_dao
|
||||
from tests import create_test_user
|
||||
|
||||
|
||||
def test_should_render_forgot_password(app_, db_, db_session):
|
||||
def test_should_render_forgot_password(app_):
|
||||
with app_.test_request_context():
|
||||
response = app_.test_client().get(url_for('.forgot_password'))
|
||||
assert response.status_code == 200
|
||||
@@ -12,18 +12,16 @@ def test_should_render_forgot_password(app_, db_, db_session):
|
||||
|
||||
|
||||
def test_should_redirect_to_password_reset_sent_and_state_updated(app_,
|
||||
db_,
|
||||
db_session,
|
||||
mock_send_email,
|
||||
mock_api_user,
|
||||
api_user_active,
|
||||
mock_user_dao_get_by_email,
|
||||
mock_user_dao_password_reset):
|
||||
with app_.test_request_context():
|
||||
response = app_.test_client().post(
|
||||
url_for('.forgot_password'),
|
||||
data={'email_address': mock_api_user.email_address})
|
||||
data={'email_address': api_user_active.email_address})
|
||||
assert response.status_code == 200
|
||||
assert (
|
||||
'You have been sent an email containing a link'
|
||||
' to reset your password.') in response.get_data(as_text=True)
|
||||
assert mock_api_user.state == 'request_password_reset'
|
||||
assert api_user_active.state == 'request_password_reset'
|
||||
|
||||
Reference in New Issue
Block a user