Fix a bug with inviting existing users to an organisation.

The method to add the user to the organisation was missing the user id. This PR fixes that.
This commit is contained in:
Rebecca Law
2019-06-27 15:34:23 +01:00
parent 149003c52c
commit d344bc7006
3 changed files with 6 additions and 6 deletions

View File

@@ -1,6 +1,5 @@
from datetime import datetime, timedelta
from unittest.mock import ANY
from uuid import UUID
import pytest
from bs4 import BeautifulSoup
@@ -84,7 +83,7 @@ def test_invite_org_user_errors_when_same_email_as_inviter(
assert normalize_spaces(page.select_one('.error-message').text) == 'You cant send an invitation to yourself'
def test_accepted_invite_when_user_already_logged_in(
def test_accepted_invite_when_other_user_already_logged_in(
client_request,
mock_check_org_invite_token
):
@@ -165,6 +164,7 @@ def test_existing_user_invite_already_is_member_of_organisation(
def test_existing_user_invite_not_a_member_of_organisation(
client,
api_user_active,
mock_check_org_invite_token,
mock_get_user_by_email,
mock_get_users_for_organisation,
@@ -186,7 +186,7 @@ def test_existing_user_invite_not_a_member_of_organisation(
mock_get_users_for_organisation.assert_called_once_with(ORGANISATION_ID)
mock_add_user_to_organisation.assert_called_once_with(
ORGANISATION_ID,
str(UUID(bytes=b'sample_org_invit', version=4))
api_user_active['id'],
)