forked from sr2/cloud-api
feat: add org user by id requires su
Part of the "sensical user adding" changes.
This commit is contained in:
parent
62c43ce883
commit
e9fe405e06
3 changed files with 23 additions and 22 deletions
|
|
@ -71,26 +71,6 @@ async def test_get_org_users_auth_root(no_su_client: AsyncClient):
|
|||
assert "Must be the org's root user" in resp.json()["detail"]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_post_org_user_auth_root(no_su_client: AsyncClient, db_session):
|
||||
db_session.add(
|
||||
User(
|
||||
email="user@test.org",
|
||||
first_name="User",
|
||||
last_name="Test",
|
||||
oidc_id="abcd-efgh-ijkl-1234",
|
||||
)
|
||||
)
|
||||
db_session.flush()
|
||||
|
||||
resp = await no_su_client.post(
|
||||
"/org/user", json={"organisation_id": 2, "user_id": 2}
|
||||
)
|
||||
assert resp.status_code != 422
|
||||
assert resp.status_code == 401
|
||||
assert "Must be the org's root user" in resp.json()["detail"]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_get_org_groups_auth_root(no_su_client: AsyncClient):
|
||||
resp = await no_su_client.get("/org/groups?org_id=2")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue