A12: Add meaningful changes/provenance to ImportRecordEvent, skip events for unchanged data
This commit is contained in:
@@ -47,7 +47,8 @@ def test_parser_and_import_are_idempotent() -> None:
|
||||
first = import_records(db, url="fixture://records", region="RU", category="records", html=html)
|
||||
second = import_records(db, url="fixture://records", region="RU", category="records", html=html)
|
||||
assert (first.rows_created, first.rows_updated) == (2, 0)
|
||||
assert (second.rows_created, second.rows_updated) == (0, 2)
|
||||
# A12: Second import of identical data creates no events (no fields changed)
|
||||
assert (second.rows_created, second.rows_updated) == (0, 0)
|
||||
assert db.scalar(select(func.count()).select_from(CatchReport).where(CatchReport.source_type == SourceType.official_record)) == 2
|
||||
assert db.scalar(select(func.count()).select_from(OfficialRecordImport)) == 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user