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

@@ -1,7 +1,6 @@
from datetime import datetime
from app.main.dao import users_dao
from app.models import User
from flask import url_for
import pytest
@@ -18,14 +17,10 @@ def test_render_sign_in_returns_sign_in_template(app_):
def test_process_sign_in_return_2fa_template(app_,
db_,
db_session,
mock_send_sms,
mock_send_email,
mock_user_dao_get_user,
mock_user_loader,
mock_user_dao_get_by_email,
mock_user_dao_checkpassword):
mock_send_verify_code,
mock_get_user,
mock_get_user_by_email,
mock_verify_password):
with app_.test_request_context():
response = app_.test_client().post(
url_for('main.sign_in'), data={
@@ -37,8 +32,6 @@ def test_process_sign_in_return_2fa_template(app_,
@pytest.mark.xfail(reason='User failed logins not implemented yet')
def test_should_return_locked_out_true_when_user_is_locked(app_,
db_,
db_session,
mock_user_dao_get_user,
mock_inactive_user_dao_get_by_email):
with app_.test_request_context():
@@ -66,8 +59,6 @@ def test_should_return_locked_out_true_when_user_is_locked(app_,
# @pytest.mark.xfail(reason='User failed logins not implemented yet')
# def test_should_return_active_user_is_false_if_user_is_inactive(app_,
# db_,
# db_session,
# mock_user_dao_get_user,
# mock_inactive_user_dao_get_by_email):
# with app_.test_request_context():
@@ -80,7 +71,7 @@ def test_should_return_locked_out_true_when_user_is_locked(app_,
# assert 'Username or password is incorrect' in response.get_data(as_text=True)
# def test_should_return_200_when_user_does_not_exist(app_, db_, db_session,
# def test_should_return_200_when_user_does_not_exist(app_,
# mock_user_dao_get_user,
# mock_user_dao_get_by_email):
# with app_.test_request_context():
@@ -92,7 +83,7 @@ def test_should_return_locked_out_true_when_user_is_locked(app_,
# assert 'Username or password is incorrect' in response.get_data(as_text=True)
# def test_should_return_200_when_user_is_not_active(app_, db_, db_session):
# def test_should_return_200_when_user_is_not_active(app_):
# user = User(email_address='PendingUser@example.gov.uk',
# password='val1dPassw0rd!',
# mobile_number='+441234123123',