Compare commits
2 commits
55a61d0df5
...
f0eaff2073
| Author | SHA1 | Date | |
|---|---|---|---|
| f0eaff2073 | |||
| 6af8490276 |
2 changed files with 33 additions and 1 deletions
|
|
@ -134,7 +134,7 @@ async def get_user_orgs(user_model: user_model_claims_dependency):
|
|||
"root_user_email": org.root_user_email,
|
||||
"billing_contact": {
|
||||
"id": org.billing_contact_id,
|
||||
"email": org.owner_contact_rel.email,
|
||||
"email": org.billing_contact_rel.email,
|
||||
},
|
||||
"owner_contact": {
|
||||
"id": org.owner_contact_id,
|
||||
|
|
|
|||
|
|
@ -111,3 +111,35 @@ async def test_post_user_invitation_accept_status_checks(
|
|||
|
||||
if resp.status_code == 401:
|
||||
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