From e3516ea0439d9a26f309ccb3bcae40deee393087 Mon Sep 17 00:00:00 2001 From: Eric Wagoner Date: Wed, 5 Aug 2026 19:50:09 -0400 Subject: [PATCH] Fix the reopen test's key collision with the fixture's Dungeon! row find_row prefers the fixture's version_ambiguous slot on a duplicate title, so the test reopened the other copy and asserted against the untouched one. A unique title removes the ambiguity the test never meant to have. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_016jXZFSTZQKzAC8fqpWSz9g --- tests/test_webreview.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_webreview.py b/tests/test_webreview.py index 109a2bb..da67d36 100644 --- a/tests/test_webreview.py +++ b/tests/test_webreview.py @@ -1167,7 +1167,7 @@ def test_wrong_match_reopens_for_research(tmp_path): rows = read_matches(cfg.matches_path) rows.append( _row( - title_raw="Dungeon!", + title_raw="Dungeom", # the misread that matched an impostor match_status="auto", bgg_id="345770", bgg_name=".dungeon", @@ -1178,15 +1178,15 @@ def test_wrong_match_reopens_for_research(tmp_path): web = TestClient(create_app(cfg, client=unauthorized_client(tmp_path))) res = web.post( "/api/reopen-match", - json={"title_raw": "Dungeon!", "source_photos": "shelf.jpg"}, + json={"title_raw": "Dungeom", "source_photos": "shelf.jpg"}, ) assert res.status_code == 200 saved = {r["title_raw"]: r for r in read_matches(cfg.matches_path)} - assert saved["Dungeon!"]["match_status"] == "unmatched" - assert saved["Dungeon!"]["bgg_id"] == "" - assert saved["Dungeon!"]["version_candidates_json"] == "[]" + assert saved["Dungeom"]["match_status"] == "unmatched" + assert saved["Dungeom"]["bgg_id"] == "" + assert saved["Dungeom"]["version_candidates_json"] == "[]" # it's back in the review queue - assert any(p["title_raw"] == "Dungeon!" for p in res.json()["pending"]) + assert any(p["title_raw"] == "Dungeom" for p in res.json()["pending"]) # an unmatched row can't be "reopened" assert ( web.post(