Trial runs itself: first enrolled phone opens a sample vote; split screen fits

This commit is contained in:
2026-11-16 22:38:43 +01:00
parent 10b6a4bec9
commit 9df596426b
4 changed files with 25 additions and 4 deletions
+7
View File
@@ -678,6 +678,13 @@ def test_trial_enrolls_then_expires(server):
async def run():
async with projector(server, p) as next_token:
c = await enroll(server, p, next_token)
# nobody can push a question on a trial, the first phone in opens the sample one
me = (await c.get(f"/api/v/{p['id']}/me")).json()
q = next(q for q in me["questions"] if q["state"] == "open")
assert me["vote_scans"] == 3
fresh = [await next_token() for _ in range(3)]
r = await c.post(f"/api/v/{p['id']}/vote", json={"question_id": q["id"], "choices": [0], "presence": fresh})
assert r.status_code == 200, r.text
await c.aclose()
asyncio.run(run())