"""A completed check can be repeated using its resulting review snapshot.""" from tests.test_submission import FIELDS, Description, setup async def test_repeat_check_uses_resulting_snapshot_without_repatch(app, logged_in): platform = await setup(app) url = "/api/v1/alphas/alpha1/submission" state = (await logged_in.get(url)).json() job_ids = [] for _ in range(2): response = await logged_in.post("/api/v1/alphas/alpha1/submission-check", json={ "snapshot": state["snapshot"], "descriptions": {"regular": Description(**FIELDS).text()}, }) assert response.status_code == 202 job_ids.append(response.json()["id"]) await app.state.runner.execute(job_ids[-1]) state = (await logged_in.get(url)).json() assert state["job"]["status"] == "completed" assert state["job"]["checkpoint"]["review_snapshot"] == state["snapshot"] assert job_ids[0] != job_ids[1] assert len(platform.patches) == 1 assert platform.calls.count(("GET", "/alphas/alpha1/check")) == 2