From the codecov patch-coverage audit of batch-2 PR #422 (comment: patch coverage 91.9%, 16 lines). The audit confirmed no security-critical enforcement line is untested — the 16 misses are defensive branches, latent-feature sub-cases, and mechanical async/demo lock reroutes. This issue tracks adding tests for the two Group-B lines worth pinning; the rest are defensive/mechanical and left uncovered by design.
Severity: Low (test coverage only)
Add tests
-
spp_change_request_v2/strategies/field_mapping.py:34 — return mappings.browse(), the fail-CLOSED path of _effective_mappings for a dynamic-approval type with no selected_field_name (applies nothing). The adjacent unmapped-selection branch (line 35) is tested; the no-selection branch is not. Add a test: a dynamic-approval field_mapping CR with an empty selected field applies/previews nothing.
-
spp_change_request_v2/models/conflict_mixin.py:528 — any_similar = True, the fuzzy-match sub-branch of dynamic duplicate detection (returns 80.0). Reached only by two dynamic-approval field_mapping CRs with the same changed-field set where a field differs but is "similar". Latent today (no shipped CR type enables dynamic approval) but worth a regression test alongside the existing dynamic-duplicate tests.
Explicitly NOT worth a test (documented for the record)
conflict_mixin.py:331/337/522 (missing-detail edge + non-existent-field skips), change_request.py:692 & change_request_detail_base.py:110 (recordset-normalization branch of _normalize_frozen_value), assign_program.py:65 (empty-program_id skip), and the eight spp_programs/spp_farmer_registry_demo _acquire/_release_operation_lock reroute call sites (async/demo paths the unit-test DB doesn't drive; the is_locked write guard itself is tested).
References
Codecov audit comment on #422; internal/plans/batch2-fix-review.md.
From the codecov patch-coverage audit of batch-2 PR #422 (comment: patch coverage 91.9%, 16 lines). The audit confirmed no security-critical enforcement line is untested — the 16 misses are defensive branches, latent-feature sub-cases, and mechanical async/demo lock reroutes. This issue tracks adding tests for the two Group-B lines worth pinning; the rest are defensive/mechanical and left uncovered by design.
Severity: Low (test coverage only)
Add tests
spp_change_request_v2/strategies/field_mapping.py:34—return mappings.browse(), the fail-CLOSED path of_effective_mappingsfor a dynamic-approval type with noselected_field_name(applies nothing). The adjacent unmapped-selection branch (line 35) is tested; the no-selection branch is not. Add a test: a dynamic-approvalfield_mappingCR with an empty selected field applies/previews nothing.spp_change_request_v2/models/conflict_mixin.py:528—any_similar = True, the fuzzy-match sub-branch of dynamic duplicate detection (returns 80.0). Reached only by two dynamic-approvalfield_mappingCRs with the same changed-field set where a field differs but is "similar". Latent today (no shipped CR type enables dynamic approval) but worth a regression test alongside the existing dynamic-duplicate tests.Explicitly NOT worth a test (documented for the record)
conflict_mixin.py:331/337/522(missing-detail edge + non-existent-field skips),change_request.py:692&change_request_detail_base.py:110(recordset-normalization branch of_normalize_frozen_value),assign_program.py:65(empty-program_idskip), and the eightspp_programs/spp_farmer_registry_demo_acquire/_release_operation_lockreroute call sites (async/demo paths the unit-test DB doesn't drive; theis_lockedwrite guard itself is tested).References
Codecov audit comment on #422;
internal/plans/batch2-fix-review.md.