Skip to content

Commit

Permalink
Fix testing adding member as user (#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
shnela authored Aug 9, 2022
1 parent 160964d commit 3c322e0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions e2e_tests/management/test_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,17 @@ def test_invite_as_non_admin(self, environment: "Environment"):
assert created_project_identifier in get_project_list(api_token=environment.user_token)

# user who created a project (`user_token` owner) will be automatically project owner
sa_is_project_owner = environment.service_account in get_project_service_account_list(
name=created_project_identifier, api_token=environment.user_token
sa_is_project_owner = (
get_project_service_account_list(
name=created_project_identifier, api_token=environment.user_token
).get(environment.service_account)
== "owner"
)
user_is_project_owner = environment.user in get_project_service_account_list(
name=created_project_identifier, api_token=environment.user_token
user_is_project_owner = (
get_project_member_list(
name=created_project_identifier, api_token=environment.user_token
).get(environment.user)
== "owner"
)
if sa_is_project_owner and not user_is_project_owner:
# SA has access to project, so tests are run as SA
Expand Down

0 comments on commit 3c322e0

Please sign in to comment.