--
This commit is contained in:
@@ -32,7 +32,7 @@ class TestFormApproval:
|
||||
async def test_every_approval_form_starts_as_draft_for_everyone(self, client, auth):
|
||||
# An MR sees all three forms as drafts; an Area Manager or admin has nothing to act on yet.
|
||||
forms = _by_table(await client.get(f"{API}/approvals", headers=auth["mr1"]))
|
||||
assert set(forms) == {"tour_plan", "standard_tour_plan", "fare_chart"}
|
||||
assert set(forms) == {"tour_plan", "standard_tour_plan", "fare_chart", "expense_statement"}
|
||||
assert {f["status"] for f in forms.values()} == {"draft"}
|
||||
for who in ("am1", "admin"):
|
||||
resp = await client.get(f"{API}/approvals", headers=auth[who])
|
||||
@@ -94,10 +94,9 @@ class TestFormApproval:
|
||||
state = _by_table(await client.get(f"{API}/approvals", headers=auth["mr1"]))["fare_chart"]
|
||||
assert state["status"] == "draft" and state["approved_by_name"] is None
|
||||
# A pending (not yet approved) form is withdrawn too, so the AM never signs stale data.
|
||||
# Deleting a row is admin-only — an MR can no longer delete their own rows.
|
||||
# An MR may remove a row they entered by mistake; that too withdraws the request.
|
||||
await client.post(f"{API}/fare_chart/approval/request", headers=auth["mr1"])
|
||||
assert (await client.delete(f"{API}/fare_chart/rows/{row_id}", headers=auth["mr1"])).status_code == 403
|
||||
assert (await client.delete(f"{API}/fare_chart/rows/{row_id}", headers=auth["admin"])).status_code == 204
|
||||
assert (await client.delete(f"{API}/fare_chart/rows/{row_id}", headers=auth["mr1"])).status_code == 204
|
||||
assert (await client.get(f"{API}/approvals", headers=auth["am1"])).json() == [] # withdrawn: nothing left for the AM
|
||||
|
||||
async def test_the_pdf_signature_comes_from_the_server_not_the_browser(self, client, auth, org, db, fare_chart):
|
||||
|
||||
Reference in New Issue
Block a user