Skip to content

Commit

Permalink
Fixed test. Added vars to settings cofig
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesstottmoj committed Jan 10, 2025
1 parent f937bea commit 32b5d80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions controlpanel/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
QUICKSIGHT_DOMAINS = ["http://localhost:8000"]
QUICKSIGHT_ASSUMED_ROLE = "arn:aws:iam::123456789012:role/quicksight_test"
IDENTITY_CENTER_ASSUMED_ROLE = "arn:aws:iam::123456789012:role/identity_center_test"
IDENTITY_CENTER_ACCOUNT_REGION = "eu-west-2"
QUICKSIGHT_READER_GROUP_NAME = "test-reader-group"
QUICKSIGHT_AUTHOR_GROUP_NAME = "test-author-group"
QUICKSIGHT_ADMIN_GROUP_NAME = "test-admin-group"
AZURE_HOLDING_GROUP_NAME = "test-holding-group"

OIDC_CPANEL_API_AUDIENCE = "test-audience"

Expand Down
3 changes: 3 additions & 0 deletions tests/frontend/views/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ def slack():
yield slack


@patch.object(aws.AWSIdentityStore, "get_group_membership_id")
@patch.object(aws.AWSIdentityStore, "get_user_id")
def test_grant_superuser_access(
get_user_id,
get_group_membership_id,
identity_store_user_setup,
identity_store,
identity_store_id,
Expand All @@ -140,6 +142,7 @@ def test_grant_superuser_access(
request_user = users["superuser"]
user = users["other_user"]
get_user_id.return_value = user.identity_center_id
get_group_membership_id.side_effect = [None, None]
client.force_login(request_user)
response = set_admin(client, users)
assert response.status_code == status.HTTP_302_FOUND
Expand Down

0 comments on commit 32b5d80

Please sign in to comment.