fix(store): enforce sighting finding id invariant

This commit is contained in:
Hiten Shah
2026-05-16 22:57:32 -07:00
parent 92d65723e4
commit 375fd0bcc0
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -451,9 +451,14 @@ def test_init_db_creates_finding_sightings_table(temp_db):
table = conn.execute(
"SELECT name FROM sqlite_master WHERE type='table' AND name='finding_sightings'"
).fetchone()
columns = {
row[1]: row[3]
for row in conn.execute("PRAGMA table_info(finding_sightings)").fetchall()
}
conn.close()
assert table is not None
assert columns["finding_id"] == 1
def test_store_findings_records_sightings_for_new_findings(temp_db):