Skip to content

Commit

Permalink
Fix permissions tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljcollinsuk committed Dec 3, 2024
1 parent 7e80594 commit 692f9aa
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/api/permissions/test_app_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# First-party/Local
from controlpanel.api.jwt_auth import AuthenticatedServiceClient
from controlpanel.api.models import App
from controlpanel.api.permissions import AppJwtPermissions


Expand Down Expand Up @@ -42,7 +43,16 @@ def users(users, authenticated_client, invalid_client_sub, invalid_client_scope)

@pytest.fixture(autouse=True)
def app(users):
app = baker.make("api.App", name="Test App 1", app_conf={"m2m": {"client_id": "abc123"}})
app = baker.make(
"api.App",
name="Test App 1",
app_conf={
"m2m": {"client_id": "abc123"},
App.KEY_WORD_FOR_AUTH_SETTINGS: {
"test": {"group_id": "test_group_id"},
},
},
)
user = users["app_admin"]
baker.make("api.UserApp", user=user, app=app, is_admin=True)

Expand Down Expand Up @@ -125,12 +135,11 @@ def app_by_name_customers(client, app, *args):


def app_by_name_add_customers(client, app, *args):
data = {"email": "[email protected]"}
data = {"emails": "[email protected]", "env_name": "test"}
with patch("controlpanel.api.models.App.add_customers"):
return client.post(
reverse("apps-by-name-customers", kwargs={"name": app.name}),
data,
query_params={"env_name": "test"},
)


Expand Down

0 comments on commit 692f9aa

Please sign in to comment.