forked from sr2/cloud-api
tests: get self orgs
This commit is contained in:
parent
6af8490276
commit
f0eaff2073
1 changed files with 32 additions and 0 deletions
|
|
@ -111,3 +111,35 @@ async def test_post_user_invitation_accept_status_checks(
|
||||||
|
|
||||||
if resp.status_code == 401:
|
if resp.status_code == 401:
|
||||||
assert resp.json()["detail"] == "Invalid JWS"
|
assert resp.json()["detail"] == "Invalid JWS"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.anyio
|
||||||
|
async def test_get_self_orgs_success(default_client: AsyncClient):
|
||||||
|
resp = await default_client.get("/user/self/orgs")
|
||||||
|
assert resp.status_code == 200
|
||||||
|
|
||||||
|
data = resp.json()
|
||||||
|
|
||||||
|
assert "organisations" in data
|
||||||
|
assert isinstance(data["organisations"], list)
|
||||||
|
assert len(data["organisations"]) > 0
|
||||||
|
|
||||||
|
org = data["organisations"][0]
|
||||||
|
assert org["organisation_id"] == 1
|
||||||
|
assert org["name"] == "Test Org"
|
||||||
|
assert org["status"] == "approved"
|
||||||
|
assert org["root_user_email"] == "admin@test.com"
|
||||||
|
assert "intake_questionnaire" in org
|
||||||
|
assert isinstance(org["intake_questionnaire"], dict)
|
||||||
|
|
||||||
|
assert isinstance(org["billing_contact"], dict)
|
||||||
|
assert org["billing_contact"]["email"] == "billing@test.org"
|
||||||
|
assert org["billing_contact"]["id"] == 1
|
||||||
|
|
||||||
|
assert isinstance(org["owner_contact"], dict)
|
||||||
|
assert org["owner_contact"]["email"] == "owner@test.org"
|
||||||
|
assert org["owner_contact"]["id"] == 2
|
||||||
|
|
||||||
|
assert isinstance(org["security_contact"], dict)
|
||||||
|
assert org["security_contact"]["email"] == "security@test.org"
|
||||||
|
assert org["security_contact"]["id"] == 3
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue