refactor(realestate-db): tuple param + status column in unnotified query
- mark_matches_notified: pass tuple(match_ids) to conn.execute for consistency - get_unnotified_matches: add a.status to SELECT so notifier/formatter can skip stale '완료' matches - add regression test: test_get_unnotified_matches_includes_status Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,3 +84,17 @@ def test_mark_matches_notified_sets_timestamp():
|
||||
with _conn() as conn:
|
||||
row = conn.execute("SELECT notified_at FROM match_results WHERE id = ?", (match_id,)).fetchone()
|
||||
assert row["notified_at"] is not None
|
||||
|
||||
|
||||
def test_get_unnotified_matches_includes_status():
|
||||
from app.db import get_unnotified_matches
|
||||
aid = _seed_announcement("StatusA", "청약중", hmno="ST", pno="1")
|
||||
with _conn() as conn:
|
||||
conn.execute("""
|
||||
INSERT INTO match_results (announcement_id, model_id, match_score, match_reasons, eligible_types, is_new)
|
||||
VALUES (?, NULL, 80, '[]', '[]', 1)
|
||||
""", (aid,))
|
||||
matches = get_unnotified_matches(min_score=70)
|
||||
status_matches = [m for m in matches if m["house_nm"] == "StatusA"]
|
||||
assert len(status_matches) == 1
|
||||
assert status_matches[0]["status"] == "청약중"
|
||||
|
||||
Reference in New Issue
Block a user