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:
@@ -11,12 +11,10 @@ from tests.conftest import mock_register_user as mock_user
|
||||
|
||||
|
||||
def test_process_register_creates_new_user(app_,
|
||||
db_,
|
||||
db_session,
|
||||
mock_send_sms,
|
||||
mock_send_email,
|
||||
mock_send_verify_code,
|
||||
mock_register_user,
|
||||
mock_user_by_email_not_found):
|
||||
mock_user_by_email_not_found,
|
||||
mock_login):
|
||||
user_data = {
|
||||
'name': 'Some One Valid',
|
||||
'email_address': 'someone@example.gov.uk',
|
||||
@@ -32,11 +30,9 @@ def test_process_register_creates_new_user(app_,
|
||||
|
||||
|
||||
def test_process_register_returns_400_when_mobile_number_is_invalid(app_,
|
||||
db_,
|
||||
db_session,
|
||||
mock_send_sms,
|
||||
mock_send_email,
|
||||
mock_user_by_email_not_found):
|
||||
mock_send_verify_code,
|
||||
mock_user_by_email_not_found,
|
||||
mock_login):
|
||||
response = app_.test_client().post('/register',
|
||||
data={'name': 'Bad Mobile',
|
||||
'email_address': 'bad_mobile@example.gov.uk',
|
||||
@@ -48,11 +44,9 @@ def test_process_register_returns_400_when_mobile_number_is_invalid(app_,
|
||||
|
||||
|
||||
def test_should_return_400_when_email_is_not_gov_uk(app_,
|
||||
db_,
|
||||
db_session,
|
||||
mock_send_sms,
|
||||
mock_send_email,
|
||||
mock_user_by_email_not_found):
|
||||
mock_send_verify_code,
|
||||
mock_user_by_email_not_found,
|
||||
mock_login):
|
||||
response = app_.test_client().post('/register',
|
||||
data={'name': 'Bad Mobile',
|
||||
'email_address': 'bad_mobile@example.not.right',
|
||||
@@ -64,13 +58,11 @@ def test_should_return_400_when_email_is_not_gov_uk(app_,
|
||||
|
||||
|
||||
def test_should_add_verify_codes_on_session(app_,
|
||||
db_,
|
||||
db_session,
|
||||
mock_send_sms,
|
||||
mock_send_email,
|
||||
mock_send_verify_code,
|
||||
mock_register_user,
|
||||
mock_user_loader,
|
||||
mock_user_by_email_not_found):
|
||||
mock_user_by_email_not_found,
|
||||
mock_login):
|
||||
user_data = {
|
||||
'name': 'Test Codes',
|
||||
'email_address': 'test@example.gov.uk',
|
||||
@@ -85,7 +77,9 @@ def test_should_add_verify_codes_on_session(app_,
|
||||
assert 'notify_admin_session' in response.headers.get('Set-Cookie')
|
||||
|
||||
|
||||
def test_should_return_400_if_password_is_blacklisted(app_, db_, db_session, mock_user_by_email_not_found):
|
||||
def test_should_return_400_if_password_is_blacklisted(app_,
|
||||
mock_user_by_email_not_found,
|
||||
mock_login):
|
||||
response = app_.test_client().post('/register',
|
||||
data={'name': 'Bad Mobile',
|
||||
'email_address': 'bad_mobile@example.not.right',
|
||||
|
||||
Reference in New Issue
Block a user