diff --git a/backend/tests/services/test_objective_backfill.py b/backend/tests/services/test_objective_backfill.py index 3da13880..99197115 100644 --- a/backend/tests/services/test_objective_backfill.py +++ b/backend/tests/services/test_objective_backfill.py @@ -77,7 +77,12 @@ def test_find_match_candidates_returns_candidates() -> None: def test_auto_apply_matches_dry_run_no_inserts() -> None: - """dry_run=True возвращает счётчики без обращения к БД (execute не вызывается).""" + """dry_run=True возвращает projected-счётчики без обращения к БД. + + auto_accepted = сколько кандидатов БЫЛО БЫ принято (preview), а не 0 — + смысл dry-run в admin-endpoint'е именно показать оператору объём перед + реальным insert. execute/commit при этом не вызываются. + """ mock_db = MagicMock() candidates = [ @@ -88,8 +93,9 @@ def test_auto_apply_matches_dry_run_no_inserts() -> None: result = auto_apply_matches(mock_db, candidates, dry_run=True) - assert result["auto_accepted"] == 0 + assert result["auto_accepted"] == 1 # projected: 1 кандидат >= AUTO_ACCEPT_THRESHOLD assert result["review_queue"] == 2 + assert result["skipped"] == 0 mock_db.execute.assert_not_called() mock_db.commit.assert_not_called()