feat: sqlite integrity error handle

This commit is contained in:
Chris Milne 2026-06-08 15:24:42 +01:00
parent da8917869f
commit b2e5dd2ebb
2 changed files with 7 additions and 1 deletions

View file

@ -226,6 +226,7 @@ async def test_post_group_success(default_client: AsyncClient):
@pytest.mark.parametrize(
"body, expected_status",
[
({"organisation_id": 1, "name": "Test Group"}, 409),
({"organisation_id": 2, "name": "new group"}, 404), # Non-existent organisation, valid name
({"organisation_id": "banana", "name": "new group"}, 422), # Invalid organisation ID, valid name
({"organisation_id": "", "name": "new group"}, 422), # Blank organisation ID, valid name
@ -505,3 +506,5 @@ async def test_post_perm_search_status_checks(default_client: AsyncClient, body:
resp = await default_client.post("/iam/permissions/search", json=body)
assert resp.status_code == expected_status