fix: rn takes org id instead of name
All checks were successful
ci / lint_and_test (push) Successful in 16s

This commit is contained in:
Chris Milne 2026-06-17 13:12:32 +01:00
parent d5854cc2c4
commit 7804816a1a
3 changed files with 15 additions and 13 deletions

View file

@ -15,7 +15,7 @@ async def test_post_act_on_resource_endpoint_success(default_client: AsyncClient
body = {
"rn": {
"service": "Test Service",
"organisation": "Org One",
"organisation_id": 1,
"resource": "test_resource",
"instance": None,
},
@ -33,6 +33,8 @@ async def test_post_act_on_resource_endpoint_success(default_client: AsyncClient
assert resp.status_code == 200
assert data["allowed"] is True
print(data)
@pytest.mark.parametrize(
"service, api_key",
@ -118,10 +120,10 @@ async def test_act_on_resource_endpoint_status_checks(
@pytest.mark.parametrize(
"service, org, resource, action, expected_response",
[
("Test Service", "Org One", "test_resource", "read", True),
("Test Service", "Org One", "test_resource", "create", False),
("Test Service", "Org One", "no_access_here", "read", False),
("Test Service", "Org Two", "test_resource", "read", False),
("Test Service", 1, "test_resource", "read", True),
("Test Service", 1, "test_resource", "create", False),
("Test Service", 1, "no_access_here", "read", False),
("Test Service", 2, "test_resource", "read", False),
],
)
@pytest.mark.anyio
@ -134,7 +136,7 @@ async def test_act_on_resource_logic(
expected_response: bool,
):
body = {
"rn": {"service": service, "organisation": org, "resource": resource},
"rn": {"service": service, "organisation_id": org, "resource": resource},
"action": action,
}
headers = {