mirror of
https://github.com/complexcaresolutions/dak.c2s.git
synced 2026-03-17 20:43:41 +00:00
test: verify duplicate detection works with new fall_id format
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a436580b03
commit
04a2e8fe93
1 changed files with 11 additions and 0 deletions
|
|
@ -266,6 +266,17 @@ class TestCheckDuplicateMocked:
|
|||
pc = _make_parsed_case()
|
||||
assert check_duplicate(db, pc) is True
|
||||
|
||||
def test_duplicate_detected_by_personal_data_when_kvnr_missing(self):
|
||||
"""Duplicate detected by personal data even when fall_id uses random suffix."""
|
||||
db = MagicMock()
|
||||
query = MagicMock()
|
||||
db.query.return_value = query
|
||||
query.filter.return_value = query
|
||||
# First .first() (fall_id check) → no match, second .first() (personal data) → match
|
||||
query.first.side_effect = [None, MagicMock()]
|
||||
pc = _make_parsed_case(kvnr=None)
|
||||
assert check_duplicate(db, pc) is True
|
||||
|
||||
|
||||
# ── preview_import with mocked DB ──────────────────────────────────────
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue