mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 03:38:26 -04:00
Working tests, hopefully all code changes done.
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user