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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jXZFSTZQKzAC8fqpWSz9g
This commit is contained in:
Eric Wagoner
2026-08-05 19:50:09 -04:00
co-authored by Claude Fable 5
parent c5daad023d
commit e3516ea043
+6 -6
View File
@@ -1167,7 +1167,7 @@ def test_wrong_match_reopens_for_research(tmp_path):
rows = read_matches(cfg.matches_path) rows = read_matches(cfg.matches_path)
rows.append( rows.append(
_row( _row(
title_raw="Dungeon!", title_raw="Dungeom", # the misread that matched an impostor
match_status="auto", match_status="auto",
bgg_id="345770", bgg_id="345770",
bgg_name=".dungeon", 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))) web = TestClient(create_app(cfg, client=unauthorized_client(tmp_path)))
res = web.post( res = web.post(
"/api/reopen-match", "/api/reopen-match",
json={"title_raw": "Dungeon!", "source_photos": "shelf.jpg"}, json={"title_raw": "Dungeom", "source_photos": "shelf.jpg"},
) )
assert res.status_code == 200 assert res.status_code == 200
saved = {r["title_raw"]: r for r in read_matches(cfg.matches_path)} saved = {r["title_raw"]: r for r in read_matches(cfg.matches_path)}
assert saved["Dungeon!"]["match_status"] == "unmatched" assert saved["Dungeom"]["match_status"] == "unmatched"
assert saved["Dungeon!"]["bgg_id"] == "" assert saved["Dungeom"]["bgg_id"] == ""
assert saved["Dungeon!"]["version_candidates_json"] == "[]" assert saved["Dungeom"]["version_candidates_json"] == "[]"
# it's back in the review queue # 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" # an unmatched row can't be "reopened"
assert ( assert (
web.post( web.post(