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

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