Server backup 2026-11-07 of uncommitted work in projects/pharma-web-celtic

Snapshot of the working tree on srv1071960 (branch main), taken during
server cleanup. .env files, node_modules, builds, logs and media were excluded.
This commit is contained in:
Shubhankar45
2026-11-07 05:43:12 +00:00
parent b001e2d03c
commit 0d30c58bf0
98 changed files with 1878 additions and 573 deletions
+7 -7
View File
@@ -23,9 +23,9 @@ class TestAdminChangesRole:
)
assert doctor.status_code == 201
resp = await _patch(client, auth, org["mr1"], {"role": "AM"})
resp = await _patch(client, auth, org["mr1"], {"role": "ABM"})
assert resp.status_code == 200, resp.text
assert resp.json()["role"] == "AM"
assert resp.json()["role"] == "ABM"
assert resp.json()["headquarters_id"] is None
# The doctor stays in the headquarters but is no longer assigned to anyone.
@@ -48,16 +48,16 @@ class TestAdminChangesRole:
assert str(org["am1"].id) not in {m["area_manager_user_id"] for m in mappings.json()}
async def test_gm_becomes_am(self, client, auth, org):
resp = await _patch(client, auth, org["gm"], {"role": "AM"})
resp = await _patch(client, auth, org["gm"], {"role": "ABM"})
assert resp.status_code == 200, resp.text
assert resp.json()["role"] == "AM"
assert resp.json()["role"] == "ABM"
async def test_role_change_signs_the_user_out(self, client, auth, org):
login = await client.post(
f"{API}/auth/login",
json={"email": org["gm"].email, "password": DEFAULT_PASSWORD},
)
await _patch(client, auth, org["gm"], {"role": "AM"})
await _patch(client, auth, org["gm"], {"role": "ABM"})
again = await client.post(
f"{API}/auth/refresh", json={"refresh_token": login.json()["refresh_token"]}
)
@@ -68,9 +68,9 @@ class TestAdminChangesRole:
assert resp.status_code == 422
async def test_admin_cannot_change_own_role(self, client, auth, org):
resp = await _patch(client, auth, org["admin"], {"role": "GM"})
resp = await _patch(client, auth, org["admin"], {"role": "AGM"})
assert resp.status_code == 422
async def test_only_admin_can_change_a_role(self, client, auth, org):
resp = await _patch(client, auth, org["mr1"], {"role": "AM"}, as_="gm")
resp = await _patch(client, auth, org["mr1"], {"role": "ABM"}, as_="gm")
assert resp.status_code == 403