Working tests, hopefully all code changes done.

This commit is contained in:
Nicholas Staples
2016-01-27 12:22:32 +00:00
parent ce81a6f540
commit 6959d695d3
57 changed files with 1143 additions and 1578 deletions

View File

@@ -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'