diff --git a/libs/labelbox/tests/conftest.py b/libs/labelbox/tests/conftest.py index a07d52c4d..9811446a8 100644 --- a/libs/labelbox/tests/conftest.py +++ b/libs/labelbox/tests/conftest.py @@ -336,6 +336,9 @@ def environ() -> Environ: raise Exception(f"Missing env key in: {os.environ}") +@pytest.mark.skip( + "Test disabled - due to security reasons, invite uid is not returned" +) def cancel_invite(client, invite_id): """ Do not use. Only for testing. diff --git a/libs/labelbox/tests/integration/test_user_management.py b/libs/labelbox/tests/integration/test_user_management.py index cfdf3c566..632898ca1 100644 --- a/libs/labelbox/tests/integration/test_user_management.py +++ b/libs/labelbox/tests/integration/test_user_management.py @@ -1,7 +1,7 @@ import pytest +from faker import Faker from labelbox import ProjectRole -from faker import Faker faker = Faker() @@ -67,6 +67,10 @@ def test_org_invite(client, organization, environ, queries, org_invite): invite, invite_limit = org_invite role = client.get_roles()["LABELER"] + assert ( + invite.uid == "invited" + ) # for security reasons we don't return the invite uid + if environ.value == "prod": invite_limit_after = organization.invite_limit() # One user added @@ -74,18 +78,23 @@ def test_org_invite(client, organization, environ, queries, org_invite): # An invite shouldn't effect the user count until after it is accepted outstanding_invites = queries.get_invites(client) - in_list = False + found_invite = None for outstanding_invite in outstanding_invites: - if outstanding_invite.uid == invite.uid: - in_list = True - org_role = outstanding_invite.organization_role_name.lower() - assert ( - org_role == role.name.lower() - ), "Role should be labeler. Found {org_role} " - assert in_list, "Invite not found" + if outstanding_invite.email == invite.email: + found_invite = outstanding_invite + break + + assert found_invite is not None, "Invite not found" + org_role = found_invite.organization_role_name.lower() + assert ( + org_role == role.name.lower() + ), "Role should be labeler. Found {org_role} " +@pytest.mark.skip( + "Test disabled - due to security reasons, invite uid is not returned" +) def test_cancel_invite( client, organization,