Vote presence: codes may span the enrollment slack as long as one is fresh (slow phones hit 'scan expiré' with 5 scans); phone drops codes too old to count
This commit is contained in:
+4
-3
@@ -518,9 +518,10 @@ def test_vote_needs_fresh_presence_scans(server):
|
||||
await asyncio.sleep(3.5) # photo of the screen taken earlier
|
||||
r = await a.post(url, json={"question_id": qid, "choices": [0], "presence": old})
|
||||
assert r.json()["error"] == "presence_required"
|
||||
fresh = [await next_token() for _ in range(3)]
|
||||
r = await a.post(url, json={"question_id": qid, "choices": [1], "presence": fresh})
|
||||
assert r.status_code == 200
|
||||
# slow phone: two codes read a while ago and one just now, all distinct, counts
|
||||
mixed = old[1:] + [await next_token()]
|
||||
r = await a.post(url, json={"question_id": qid, "choices": [1], "presence": mixed})
|
||||
assert r.status_code == 200, r.text
|
||||
await a.aclose()
|
||||
|
||||
asyncio.run(run())
|
||||
|
||||
Reference in New Issue
Block a user