Skip to content

Seed EntitledTo-style integration tests (#778)#1713

Open
vahid-ahmadi wants to merge 1 commit into
mainfrom
vahid-ahmadi/issue-778-entitledto-integration-tests
Open

Seed EntitledTo-style integration tests (#778)#1713
vahid-ahmadi wants to merge 1 commit into
mainfrom
vahid-ahmadi/issue-778-entitledto-integration-tests

Conversation

@vahid-ahmadi
Copy link
Copy Markdown
Collaborator

Summary

  • First batch of worked benefit scenarios for Integration tests from EntitledTo #778, which asks for ~20 EntitledTo-aligned integration tests.
  • New file at policyengine_uk/tests/policy/integration/entitledto_scenarios.yaml with three common household shapes:
    1. Single 30-year-old working part-time on low pay, private renter in London — exercises UC, no income tax / NI, child benefit zero.
    2. Couple with two children, one earner at £22k, social housing in North West — exercises UC, child benefit, partial income tax + NI (asserted via household_tax).
    3. Pensioner couple with low state pension (£14k combined) — sits below the Pension Credit guarantee level; exercises Pension Credit and Winter Fuel Allowance.
  • Values are pinned to PolicyEngine's current output. The file is labelled as a regression-grade baseline rather than an authoritative EntitledTo cross-validation — future work is to manually re-run the matching cases through EntitledTo and tighten any rows where the two disagree, ratcheting up to the ~20-scenario coverage in Integration tests from EntitledTo #778.
  • Person-level variables (income_tax, national_insurance) can't be asserted with a single scalar across a multi-person benunit, so scenario 2 uses household_tax (the aggregate that already includes both).

Test plan

  • policyengine-core test policyengine_uk/tests/policy/integration/entitledto_scenarios.yaml -c policyengine_uk (3 passed).

🤖 Generated with Claude Code

#778 asks for ~20 worked benefit scenarios checked against EntitledTo.
This is a first batch of three covering the most common household
shapes the calculator handles:

1. single 30-year-old working part-time on low pay, private renter in
   London (UC + child benefit zero, no income tax/NI),
2. couple with two children, one earner at £22k, social housing in
   North West (UC + child benefit, partial NI/income tax),
3. pensioner couple with low state pension, sits below Pension Credit
   guarantee level (PC payout + winter fuel allowance).

Values are pinned to the current PolicyEngine output and the file is
labelled as a regression-grade baseline rather than an authoritative
EntitledTo cross-validation — future work is to manually re-run the
matching cases through EntitledTo and tighten any rows where the two
disagree, ratcheting up to the ~20-scenario coverage in the issue.

Person-level variables (income_tax, national_insurance) can't be
asserted with a single scalar when multiple people are in the benunit,
so scenario 2 uses household_tax instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant