Hand-added votes: pad per-answer counts to the option count; test covers it

This commit is contained in:
2026-11-17 14:46:46 +01:00
parent c924107f1d
commit 85ff0d6507
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -168,7 +168,8 @@ def test_full_flow_and_anonymity(server):
assert admin(server, p, "POST", f"/questions/{qid}/close").status_code == 200
q = admin(server, p, "GET", "").json()["questions"][0]
assert q["results"] == {"counts": [1, 0], "blank": 1, "ballots": 2}
assert q["results"] == {"counts": [1, 0], "blank": 1, "ballots": 2,
"extra": {"counts": [0, 0], "blank": 0, "ballots": 0}}
r = await a.post(f"/api/v/{p['id']}/vote", json={"question_id": qid, "choices": [0]})
assert r.status_code == 409 and r.json()["error"] == "not_open"