Updated form and fixed existing tests.

This commit is contained in:
Nicholas Staples
2016-03-03 13:00:12 +00:00
parent 32b84f4ce2
commit 9e710711cb
7 changed files with 73 additions and 58 deletions

View File

@@ -9,7 +9,8 @@ def test_should_show_overview_page(
mock_login,
mock_get_service,
mock_get_users_by_service,
mock_get_invites_for_service
mock_get_invites_for_service,
mock_has_permissions
):
with app_.test_request_context():
with app_.test_client() as client:
@@ -25,7 +26,8 @@ def test_should_show_page_for_one_user(
app_,
api_user_active,
mock_login,
mock_get_service
mock_get_service,
mock_has_permissions
):
with app_.test_request_context():
with app_.test_client() as client:
@@ -41,7 +43,8 @@ def test_redirect_after_saving_user(
mock_login,
mock_get_service,
mock_get_users_by_service,
mock_get_invites_for_service
mock_get_invites_for_service,
mock_has_permissions
):
with app_.test_request_context():
with app_.test_client() as client:
@@ -60,7 +63,9 @@ def test_should_show_page_for_inviting_user(
app_,
api_user_active,
mock_login,
mock_get_service
mock_get_user,
mock_get_service,
mock_has_permissions
):
with app_.test_request_context():
with app_.test_client() as client:
@@ -76,9 +81,12 @@ def test_invite_user(
service_one,
api_user_active,
mock_login,
mock_get_user,
mock_get_service,
mock_get_users_by_service,
mock_create_invite,
mock_get_invites_for_service
mock_get_invites_for_service,
mock_has_permissions
):
from_user = api_user_active.id
service_id = service_one['id']
@@ -106,7 +114,11 @@ def test_invite_user(
assert flash_banner == 'Invite sent to test@example.gov.uk'
def test_cancel_invited_user_cancels_user_invitations(app_, api_user_active, mock_login, mocker):
def test_cancel_invited_user_cancels_user_invitations(app_,
api_user_active,
mock_login,
mocker,
mock_has_permissions):
with app_.test_request_context():
with app_.test_client() as client:
mocker.patch('app.invite_api_client.cancel_invited_user')