From d8a4dc43caa82e5478e96b6a785cc597c57ee5c4 Mon Sep 17 00:00:00 2001 From: Anthony Volk <14987227+anth-volk@users.noreply.github.com> Date: Fri, 9 Oct 2026 04:27:47 +0400 Subject: [PATCH 1/5] Correct historical higher pension-age Housing Benefit allowances --- changelog.d/hb-pensioner-history.fixed.md | 1 + .../allowances/couple/aged.yaml | 22 ++- .../allowances/lone_parent/aged.yaml | 22 ++- .../allowances/single/aged.yaml | 22 ++- .../housing_benefit_pensioner_history.yaml | 169 ++++++++++++++++++ 5 files changed, 233 insertions(+), 3 deletions(-) create mode 100644 changelog.d/hb-pensioner-history.fixed.md create mode 100644 policyengine_uk/tests/policy/baseline/finance/benefit/family/housing_benefit/housing_benefit_pensioner_history.yaml diff --git a/changelog.d/hb-pensioner-history.fixed.md b/changelog.d/hb-pensioner-history.fixed.md new file mode 100644 index 0000000000..7ffe878c33 --- /dev/null +++ b/changelog.d/hb-pensioner-history.fixed.md @@ -0,0 +1 @@ +- Corrected the higher pension-age Housing Benefit personal allowances for 2015 to 2018, retaining the 2019 rates from 2019. diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged.yaml index 12cf678445..b7a3c35b93 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged.yaml @@ -1,6 +1,26 @@ description: The following couple personal allowance is provided under the Housing Benefit if at least one member is over the state pension age threshold. values: - 2015-04-01: 270.6 + 2015-04-01: + value: 248.3 + reference: + - title: The Social Security Benefits Up-rating Order 2015, Schedule 7 + href: https://www.legislation.gov.uk/uksi/2015/457/schedule/7/made + 2016-04-01: + value: 252.3 + reference: + - title: The Social Security Benefits (Adjustment of Amounts and Thresholds) Regulations 2016, regulation 6 + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/6/made + 2017-04-01: + value: 258.15 + reference: + - title: The Social Security Benefits Up-rating Order 2017, Schedule 7 + href: https://www.legislation.gov.uk/uksi/2017/260/schedule/7/made + 2018-04-01: + value: 263.8 + reference: + - title: The Social Security Benefits Up-rating Order 2018, Schedule 6 + href: https://www.legislation.gov.uk/uksi/2018/281/schedule/6/made + 2019-04-01: 270.6 2021-04-01: 286.05 2022-04-06: 294.9 2023-04-01: 324.7 diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged.yaml index 0292f05a7c..1e5a194f86 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged.yaml @@ -1,7 +1,27 @@ description: Personal allowance for Housing Benefit for a lone parent over State Pension age. values: - 2015-04-01: 181 + 2015-04-01: + value: 166.05 + reference: + - title: The Social Security Benefits Up-rating Order 2015, Schedule 7 + href: https://www.legislation.gov.uk/uksi/2015/457/schedule/7/made + 2016-04-01: + value: 168.7 + reference: + - title: The Social Security Benefits (Adjustment of Amounts and Thresholds) Regulations 2016, regulation 6 + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/6/made + 2017-04-01: + value: 172.55 + reference: + - title: The Social Security Benefits Up-rating Order 2017, Schedule 7 + href: https://www.legislation.gov.uk/uksi/2017/260/schedule/7/made + 2018-04-01: + value: 176.4 + reference: + - title: The Social Security Benefits Up-rating Order 2018, Schedule 6 + href: https://www.legislation.gov.uk/uksi/2018/281/schedule/6/made + 2019-04-01: 181 2021-04-01: 191.15 2022-04-06: 197.1 2023-04-01: 217 diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged.yaml index c3bf99f4ba..1ebc166b30 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged.yaml @@ -1,6 +1,26 @@ description: The following personal allowance amount is provided to single filers over the pension age under the Housing Benefit. values: - 2015-04-01: 181 + 2015-04-01: + value: 166.05 + reference: + - title: The Social Security Benefits Up-rating Order 2015, Schedule 7 + href: https://www.legislation.gov.uk/uksi/2015/457/schedule/7/made + 2016-04-01: + value: 168.7 + reference: + - title: The Social Security Benefits (Adjustment of Amounts and Thresholds) Regulations 2016, regulation 6 + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/6/made + 2017-04-01: + value: 172.55 + reference: + - title: The Social Security Benefits Up-rating Order 2017, Schedule 7 + href: https://www.legislation.gov.uk/uksi/2017/260/schedule/7/made + 2018-04-01: + value: 176.4 + reference: + - title: The Social Security Benefits Up-rating Order 2018, Schedule 6 + href: https://www.legislation.gov.uk/uksi/2018/281/schedule/6/made + 2019-04-01: 181 2021-04-01: 191.15 2022-04-06: 197.1 2023-04-01: 217 diff --git a/policyengine_uk/tests/policy/baseline/finance/benefit/family/housing_benefit/housing_benefit_pensioner_history.yaml b/policyengine_uk/tests/policy/baseline/finance/benefit/family/housing_benefit/housing_benefit_pensioner_history.yaml new file mode 100644 index 0000000000..dff74880e5 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/finance/benefit/family/housing_benefit/housing_benefit_pensioner_history.yaml @@ -0,0 +1,169 @@ +# Higher category only: Schedule 3 paragraph 1, age 65 or over. + +- name: Higher pension-age single allowance in 2015 + period: 2015 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: true + is_couple: false + is_lone_parent: false + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 166.05 * 52 + +- name: Higher pension-age single allowance in 2016 + period: 2016 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: true + is_couple: false + is_lone_parent: false + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 168.7 * 52 + +- name: Higher pension-age single allowance in 2017 + period: 2017 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: true + is_couple: false + is_lone_parent: false + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 172.55 * 52 + +- name: Higher pension-age single allowance in 2018 + period: 2018 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: true + is_couple: false + is_lone_parent: false + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 176.4 * 52 + +- name: Higher pension-age lone parent allowance in 2015 + period: 2015 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: false + is_couple: false + is_lone_parent: true + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 166.05 * 52 + +- name: Higher pension-age lone parent allowance in 2016 + period: 2016 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: false + is_couple: false + is_lone_parent: true + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 168.7 * 52 + +- name: Higher pension-age lone parent allowance in 2017 + period: 2017 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: false + is_couple: false + is_lone_parent: true + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 172.55 * 52 + +- name: Higher pension-age lone parent allowance in 2018 + period: 2018 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: false + is_couple: false + is_lone_parent: true + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 176.4 * 52 + +- name: Higher pension-age couple allowance in 2015 + period: 2015 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: false + is_couple: true + is_lone_parent: false + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 248.3 * 52 + +- name: Higher pension-age couple allowance in 2016 + period: 2016 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: false + is_couple: true + is_lone_parent: false + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 252.3 * 52 + +- name: Higher pension-age couple allowance in 2017 + period: 2017 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: false + is_couple: true + is_lone_parent: false + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 258.15 * 52 + +- name: Higher pension-age couple allowance in 2018 + period: 2018 + absolute_error_margin: 0.01 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 70 + is_single_person: false + is_couple: true + is_lone_parent: false + benefits_premiums: 0 + output: + housing_benefit_applicable_amount: 263.8 * 52 From b632ba7ce67b85d8ec43ff12480fb7c4bc51f17a Mon Sep 17 00:00:00 2001 From: Anthony Volk <14987227+anth-volk@users.noreply.github.com> Date: Fri, 9 Oct 2026 17:04:03 +0400 Subject: [PATCH 2/5] Route historical under-65 Housing Benefit pensioner allowances --- changelog.d/hb-under-65-history.fixed.md | 1 + .../allowances/couple/aged_under_65.yaml | 60 ++++++++++ .../allowances/lone_parent/aged_under_65.yaml | 60 ++++++++++ .../allowances/single/aged_under_65.yaml | 60 ++++++++++ .../housing_benefit_applicable_amount.yaml | 103 ++++++++++++++++++ .../housing_benefit_applicable_amount.py | 24 +++- 6 files changed, 305 insertions(+), 3 deletions(-) create mode 100644 changelog.d/hb-under-65-history.fixed.md create mode 100644 policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged_under_65.yaml create mode 100644 policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged_under_65.yaml create mode 100644 policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged_under_65.yaml diff --git a/changelog.d/hb-under-65-history.fixed.md b/changelog.d/hb-under-65-history.fixed.md new file mode 100644 index 0000000000..a2e82102a7 --- /dev/null +++ b/changelog.d/hb-under-65-history.fixed.md @@ -0,0 +1 @@ +- Use the separate historical under-65 pensioner Housing Benefit allowances, with jurisdiction-specific category end dates and the existing annual sampling convention. diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged_under_65.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged_under_65.yaml new file mode 100644 index 0000000000..5c8593ce8a --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged_under_65.yaml @@ -0,0 +1,60 @@ +description: Historical lower Housing Benefit pensioner allowance for couple families below age 65. +amount: + description: Weekly allowance for the former qualifying under-65 pensioner category. + values: + 2015-04-01: + value: 230.85 + reference: + - title: GB pensioner Housing Benefit allowances, 2015 + href: https://www.legislation.gov.uk/uksi/2015/457/schedule/7/made + - title: NI pensioner Housing Benefit allowances, 2015 + href: https://www.legislation.gov.uk/nisr/2015/124/schedule/7/made + 2016-04-01: + value: 237.55 + reference: + - title: GB pensioner Housing Benefit allowances, 2016 + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/6/made + - title: NI pensioner Housing Benefit allowances, 2016 + href: https://www.legislation.gov.uk/nisr/2016/110/regulation/6/made + 2017-04-01: + value: 243.25 + reference: + - title: GB pensioner Housing Benefit allowances, 2017 + href: https://www.legislation.gov.uk/uksi/2017/260/schedule/7/made + - title: NI pensioner Housing Benefit allowances, 2017 + href: https://www.legislation.gov.uk/nisr/2017/56/schedule/7/made + 2018-04-01: + value: 248.8 + reference: + - title: GB pensioner Housing Benefit allowances, 2018 + href: https://www.legislation.gov.uk/uksi/2018/281/schedule/6/made + - title: NI pensioner Housing Benefit allowances, 2018 + href: https://www.legislation.gov.uk/nisr/2018/58/schedule/6/made + metadata: + unit: currency-GBP + period: week + label: Housing Benefit historical lower couple allowance +age_limit_great_britain: + description: Upper age boundary for the former GB pensioner allowance category; zero after its removal. + values: + 2015-04-01: 65 + 2018-12-06: + value: 0 + reference: + - title: Social Security (Miscellaneous Amendments No. 5) Regulations 2017, regulations 1(2)(b) and 7(7) + href: https://www.legislation.gov.uk/uksi/2017/1187/made + metadata: + unit: year + label: Historical lower GB pensioner allowance age limit +age_limit_northern_ireland: + description: Upper age boundary for the former NI pensioner allowance category; zero in the April 2019 replacement table. + values: + 2015-04-01: 65 + 2019-04-01: + value: 0 + reference: + - title: NI Social Security Benefits Up-rating Order 2019, articles 1 and 24 and Schedule 4 + href: https://www.legislation.gov.uk/nisr/2019/58/made + metadata: + unit: year + label: Historical lower NI pensioner allowance age limit diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged_under_65.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged_under_65.yaml new file mode 100644 index 0000000000..db22f430f7 --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged_under_65.yaml @@ -0,0 +1,60 @@ +description: Historical lower Housing Benefit pensioner allowance for lone parent families below age 65. +amount: + description: Weekly allowance for the former qualifying under-65 pensioner category. + values: + 2015-04-01: + value: 151.2 + reference: + - title: GB pensioner Housing Benefit allowances, 2015 + href: https://www.legislation.gov.uk/uksi/2015/457/schedule/7/made + - title: NI pensioner Housing Benefit allowances, 2015 + href: https://www.legislation.gov.uk/nisr/2015/124/schedule/7/made + 2016-04-01: + value: 155.6 + reference: + - title: GB pensioner Housing Benefit allowances, 2016 + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/6/made + - title: NI pensioner Housing Benefit allowances, 2016 + href: https://www.legislation.gov.uk/nisr/2016/110/regulation/6/made + 2017-04-01: + value: 159.35 + reference: + - title: GB pensioner Housing Benefit allowances, 2017 + href: https://www.legislation.gov.uk/uksi/2017/260/schedule/7/made + - title: NI pensioner Housing Benefit allowances, 2017 + href: https://www.legislation.gov.uk/nisr/2017/56/schedule/7/made + 2018-04-01: + value: 163 + reference: + - title: GB pensioner Housing Benefit allowances, 2018 + href: https://www.legislation.gov.uk/uksi/2018/281/schedule/6/made + - title: NI pensioner Housing Benefit allowances, 2018 + href: https://www.legislation.gov.uk/nisr/2018/58/schedule/6/made + metadata: + unit: currency-GBP + period: week + label: Housing Benefit historical lower lone parent allowance +age_limit_great_britain: + description: Upper age boundary for the former GB pensioner allowance category; zero after its removal. + values: + 2015-04-01: 65 + 2018-12-06: + value: 0 + reference: + - title: Social Security (Miscellaneous Amendments No. 5) Regulations 2017, regulations 1(2)(b) and 7(7) + href: https://www.legislation.gov.uk/uksi/2017/1187/made + metadata: + unit: year + label: Historical lower GB pensioner allowance age limit +age_limit_northern_ireland: + description: Upper age boundary for the former NI pensioner allowance category; zero in the April 2019 replacement table. + values: + 2015-04-01: 65 + 2019-04-01: + value: 0 + reference: + - title: NI Social Security Benefits Up-rating Order 2019, articles 1 and 24 and Schedule 4 + href: https://www.legislation.gov.uk/nisr/2019/58/made + metadata: + unit: year + label: Historical lower NI pensioner allowance age limit diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged_under_65.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged_under_65.yaml new file mode 100644 index 0000000000..87a48c15eb --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged_under_65.yaml @@ -0,0 +1,60 @@ +description: Historical lower Housing Benefit pensioner allowance for single families below age 65. +amount: + description: Weekly allowance for the former qualifying under-65 pensioner category. + values: + 2015-04-01: + value: 151.2 + reference: + - title: GB pensioner Housing Benefit allowances, 2015 + href: https://www.legislation.gov.uk/uksi/2015/457/schedule/7/made + - title: NI pensioner Housing Benefit allowances, 2015 + href: https://www.legislation.gov.uk/nisr/2015/124/schedule/7/made + 2016-04-01: + value: 155.6 + reference: + - title: GB pensioner Housing Benefit allowances, 2016 + href: https://www.legislation.gov.uk/uksi/2016/242/regulation/6/made + - title: NI pensioner Housing Benefit allowances, 2016 + href: https://www.legislation.gov.uk/nisr/2016/110/regulation/6/made + 2017-04-01: + value: 159.35 + reference: + - title: GB pensioner Housing Benefit allowances, 2017 + href: https://www.legislation.gov.uk/uksi/2017/260/schedule/7/made + - title: NI pensioner Housing Benefit allowances, 2017 + href: https://www.legislation.gov.uk/nisr/2017/56/schedule/7/made + 2018-04-01: + value: 163 + reference: + - title: GB pensioner Housing Benefit allowances, 2018 + href: https://www.legislation.gov.uk/uksi/2018/281/schedule/6/made + - title: NI pensioner Housing Benefit allowances, 2018 + href: https://www.legislation.gov.uk/nisr/2018/58/schedule/6/made + metadata: + unit: currency-GBP + period: week + label: Housing Benefit historical lower single allowance +age_limit_great_britain: + description: Upper age boundary for the former GB pensioner allowance category; zero after its removal. + values: + 2015-04-01: 65 + 2018-12-06: + value: 0 + reference: + - title: Social Security (Miscellaneous Amendments No. 5) Regulations 2017, regulations 1(2)(b) and 7(7) + href: https://www.legislation.gov.uk/uksi/2017/1187/made + metadata: + unit: year + label: Historical lower GB pensioner allowance age limit +age_limit_northern_ireland: + description: Upper age boundary for the former NI pensioner allowance category; zero in the April 2019 replacement table. + values: + 2015-04-01: 65 + 2019-04-01: + value: 0 + reference: + - title: NI Social Security Benefits Up-rating Order 2019, articles 1 and 24 and Schedule 4 + href: https://www.legislation.gov.uk/nisr/2019/58/made + metadata: + unit: year + label: Historical lower NI pensioner allowance age limit diff --git a/policyengine_uk/tests/policy/baseline/finance/benefit/family/housing_benefit/housing_benefit_applicable_amount.yaml b/policyengine_uk/tests/policy/baseline/finance/benefit/family/housing_benefit/housing_benefit_applicable_amount.yaml index eeea8a6e58..8cd6c277c9 100644 --- a/policyengine_uk/tests/policy/baseline/finance/benefit/family/housing_benefit/housing_benefit_applicable_amount.yaml +++ b/policyengine_uk/tests/policy/baseline/finance/benefit/family/housing_benefit/housing_benefit_applicable_amount.yaml @@ -115,3 +115,106 @@ benefits_premiums: 0 output: housing_benefit_applicable_amount: 108.3 * 52 + +- name: "Historical 2015 lower/higher pensioner allowances in GB and NI" + period: 2015 + absolute_error_margin: 0.02 + input: + country: ["ENGLAND","ENGLAND","ENGLAND","ENGLAND","ENGLAND","ENGLAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND"] + housing_benefit_eligible: [true,true,true,true,true,true,true,true,true,true,true,true] + housing_benefit_pension_age_regulations_apply: [true,true,true,true,true,true,true,true,true,true,true,true] + eldest_claimant_or_partner_age: [64,65,64,65,64,65,64,65,64,65,64,65] + is_single_person: [true,true,false,false,false,false,true,true,false,false,false,false] + is_lone_parent: [false,false,true,true,false,false,false,false,true,true,false,false] + is_couple: [false,false,false,false,true,true,false,false,false,false,true,true] + benefits_premiums: [0,0,0,0,0,0,0,0,0,0,0,0] + output: + housing_benefit_applicable_amount: [7862.4,8634.6,7862.4,8634.6,12004.199999999999,12911.6,7862.4,8634.6,7862.4,8634.6,12004.199999999999,12911.6] + +- name: "Historical 2016 lower/higher pensioner allowances in GB and NI" + period: 2016 + absolute_error_margin: 0.02 + input: + country: ["ENGLAND","ENGLAND","ENGLAND","ENGLAND","ENGLAND","ENGLAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND"] + housing_benefit_eligible: [true,true,true,true,true,true,true,true,true,true,true,true] + housing_benefit_pension_age_regulations_apply: [true,true,true,true,true,true,true,true,true,true,true,true] + eldest_claimant_or_partner_age: [64,65,64,65,64,65,64,65,64,65,64,65] + is_single_person: [true,true,false,false,false,false,true,true,false,false,false,false] + is_lone_parent: [false,false,true,true,false,false,false,false,true,true,false,false] + is_couple: [false,false,false,false,true,true,false,false,false,false,true,true] + benefits_premiums: [0,0,0,0,0,0,0,0,0,0,0,0] + output: + housing_benefit_applicable_amount: [8091.2,8772.4,8091.2,8772.4,12352.6,13119.6,8091.2,8772.4,8091.2,8772.4,12352.6,13119.6] + +- name: "Historical 2017 lower/higher pensioner allowances in GB and NI" + period: 2017 + absolute_error_margin: 0.02 + input: + country: ["ENGLAND","ENGLAND","ENGLAND","ENGLAND","ENGLAND","ENGLAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND"] + housing_benefit_eligible: [true,true,true,true,true,true,true,true,true,true,true,true] + housing_benefit_pension_age_regulations_apply: [true,true,true,true,true,true,true,true,true,true,true,true] + eldest_claimant_or_partner_age: [64,65,64,65,64,65,64,65,64,65,64,65] + is_single_person: [true,true,false,false,false,false,true,true,false,false,false,false] + is_lone_parent: [false,false,true,true,false,false,false,false,true,true,false,false] + is_couple: [false,false,false,false,true,true,false,false,false,false,true,true] + benefits_premiums: [0,0,0,0,0,0,0,0,0,0,0,0] + output: + housing_benefit_applicable_amount: [8286.199999999999,8972.6,8286.199999999999,8972.6,12649,13423.8,8286.199999999999,8972.6,8286.199999999999,8972.6,12649,13423.8] + +- name: "Historical 2018 lower/higher pensioner allowances in GB and NI" + period: 2018 + absolute_error_margin: 0.02 + input: + country: ["ENGLAND","ENGLAND","ENGLAND","ENGLAND","ENGLAND","ENGLAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND","NORTHERN_IRELAND"] + housing_benefit_eligible: [true,true,true,true,true,true,true,true,true,true,true,true] + housing_benefit_pension_age_regulations_apply: [true,true,true,true,true,true,true,true,true,true,true,true] + eldest_claimant_or_partner_age: [64,65,64,65,64,65,64,65,64,65,64,65] + is_single_person: [true,true,false,false,false,false,true,true,false,false,false,false] + is_lone_parent: [false,false,true,true,false,false,false,false,true,true,false,false] + is_couple: [false,false,false,false,true,true,false,false,false,false,true,true] + benefits_premiums: [0,0,0,0,0,0,0,0,0,0,0,0] + output: + housing_benefit_applicable_amount: [8476,9172.800000000001,8476,9172.800000000001,12937.6,13717.6,8476,9172.800000000001,8476,9172.800000000001,12937.6,13717.6] + +- name: "Both jurisdictions use the higher category after abolition under annual sampling" + period: 2019 + absolute_error_margin: 0.02 + input: + country: ["ENGLAND","NORTHERN_IRELAND"] + housing_benefit_eligible: [true,true] + housing_benefit_pension_age_regulations_apply: [true,true] + eldest_claimant_or_partner_age: [64,64] + is_single_person: [true,true] + is_lone_parent: [false,false] + is_couple: [false,false] + benefits_premiums: [0,0] + output: + housing_benefit_applicable_amount: [9412,9412] + +- name: "A zero lower amount reform is not overwritten by the higher allowance" + period: 2017 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: true + eldest_claimant_or_partner_age: 64 + is_single_person: true + is_lone_parent: false + is_couple: false + benefits_premiums: 0 + gov.dwp.housing_benefit.allowances.single.aged_under_65.amount: 0 + output: + housing_benefit_applicable_amount: 0 + +- name: "A working-age family does not use the historical pensioner category" + period: 2017 + input: + housing_benefit_eligible: true + housing_benefit_pension_age_regulations_apply: false + eldest_claimant_or_partner_age: 64 + is_single_person: true + is_lone_parent: false + is_couple: false + benefits_premiums: 0 + gov.dwp.housing_benefit.allowances.single.older: 100 + output: + housing_benefit_applicable_amount: 5200 diff --git a/policyengine_uk/variables/gov/dwp/housing_benefit/housing_benefit_applicable_amount.py b/policyengine_uk/variables/gov/dwp/housing_benefit/housing_benefit_applicable_amount.py index cba43eaafe..ef15be85d6 100644 --- a/policyengine_uk/variables/gov/dwp/housing_benefit/housing_benefit_applicable_amount.py +++ b/policyengine_uk/variables/gov/dwp/housing_benefit/housing_benefit_applicable_amount.py @@ -11,6 +11,8 @@ class housing_benefit_applicable_amount(Variable): reference = ( "https://www.legislation.gov.uk/uksi/2006/213/schedule/3", "https://www.legislation.gov.uk/uksi/2006/214/schedule/3", + "https://www.legislation.gov.uk/uksi/2017/1187/regulation/7", + "https://www.legislation.gov.uk/nisr/2019/58/schedule/4/made", ) def formula(benunit, period, parameters): @@ -31,20 +33,36 @@ def formula(benunit, period, parameters): single = benunit("is_single_person", period) couple = benunit("is_couple", period) lone_parent = benunit("is_lone_parent", period) + country = benunit.household("country", period) + northern_ireland = country == country.possible_values.NORTHERN_IRELAND + + def pensioner_allowance(category): + # Existing 30-April fiscal-year convention: the raw GB category + # ends on 6 December 2018; NI's replacement table is April 2019. + # Neither date is a new claimant-history input. A zero reform of + # the lower amount must remain zero, not fall back to the higher. + lower = category.aged_under_65 + age_limit = where( + northern_ireland, + lower.age_limit_northern_ireland, + lower.age_limit_great_britain, + ) + return where(eldest_age < age_limit, lower.amount, category.aged) + single_personal_allowance = ( u_25 * p.single.younger + o_25 * p.single.older - + pension_age_regulations * p.single.aged + + pension_age_regulations * pensioner_allowance(p.single) ) couple_personal_allowance = ( u_18 * p.couple.younger + o_18 * p.couple.older - + pension_age_regulations * p.couple.aged + + pension_age_regulations * pensioner_allowance(p.couple) ) lone_parent_personal_allowance = ( u_18 * p.lone_parent.younger + o_18 * p.lone_parent.older - + pension_age_regulations * p.lone_parent.aged + + pension_age_regulations * pensioner_allowance(p.lone_parent) ) personal_allowance = ( single * single_personal_allowance From 96ed76ead014d9c9edb3a7a934de45d0b307fcd1 Mon Sep 17 00:00:00 2001 From: Anthony Volk <14987227+anth-volk@users.noreply.github.com> Date: Fri, 9 Oct 2026 18:49:17 +0400 Subject: [PATCH 3/5] Align historical allowance regressions with combined HB corrections --- ...housing_benefit_pension_age_means_test.yaml | 18 +++++++++++------- .../state_pension_credit_qualifying_age.yaml | 12 ++++++++---- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/policyengine_uk/tests/policy/baseline/gov/dwp/housing_benefit_pension_age_means_test.yaml b/policyengine_uk/tests/policy/baseline/gov/dwp/housing_benefit_pension_age_means_test.yaml index 4e721cbe6b..d45fb05179 100644 --- a/policyengine_uk/tests/policy/baseline/gov/dwp/housing_benefit_pension_age_means_test.yaml +++ b/policyengine_uk/tests/policy/baseline/gov/dwp/housing_benefit_pension_age_means_test.yaml @@ -1,9 +1,13 @@ # HB Regs 2006 reg 5 and HB (SPC) Regs 2006 reg 5 route a claimant on # income-based JSA to the working-age regulations even after the qualifying # age. CTR SI 2012/2885 reg 3 applies the same exclusion to its pensioner test. -# These tests preserve the model's existing historical allowance parameters: -# 73.10 * 52 = 3,801.20 and 181 * 52 = 9,412, without asserting that the -# shared pension-age allowance parameter reproduces every statutory age band. +# Working-age allowance: 73.10 * 52 = 3,801.20. A qualifying 64-year-old +# under the pension-age HB regulations has the lower allowance: +# 159.35 * 52 = 8,286.20 (SI 2017/260 Schedule 7). +# https://www.legislation.gov.uk/uksi/2017/260/schedule/7/made +# CTR reads the same higher-category HB rate: 172.55 * 52 = 8,972.60. +# Its existing formula does not select the historical under-65 category; +# these CTR assertions test that unchanged approximation, not its legal rate. - name: Qualifying-age claimant on income-based JSA uses working-age HB and CTR allowances period: 2017 @@ -64,8 +68,8 @@ housing_benefit_pension_age_regulations_apply: true council_tax_reduction_pensioner: true benefits_premiums: 0 - housing_benefit_applicable_amount: 9_412 - council_tax_reduction_applicable_amount: 9_412 + housing_benefit_applicable_amount: 8_286.20 + council_tax_reduction_applicable_amount: 8_972.60 - name: Synthetic component routing does not apply the pension-age guarantee-credit passport under working-age flags # This fixes the scheme flags and income components to test their consumers; @@ -146,8 +150,8 @@ savings: 12_000 output: has_attained_state_pension_credit_qualifying_age: true - housing_benefit_applicable_amount: 9_412 - council_tax_reduction_applicable_amount: 9_412 + housing_benefit_applicable_amount: 8_286.20 + council_tax_reduction_applicable_amount: 8_972.60 housing_benefit_assessable_capital: 0 housing_benefit_tariff_income: 0 housing_benefit_applicable_income: 0 diff --git a/policyengine_uk/tests/policy/baseline/gov/dwp/pension_credit/state_pension_credit_qualifying_age.yaml b/policyengine_uk/tests/policy/baseline/gov/dwp/pension_credit/state_pension_credit_qualifying_age.yaml index e993dfbfb0..2c2e3c3dc5 100644 --- a/policyengine_uk/tests/policy/baseline/gov/dwp/pension_credit/state_pension_credit_qualifying_age.yaml +++ b/policyengine_uk/tests/policy/baseline/gov/dwp/pension_credit/state_pension_credit_qualifying_age.yaml @@ -327,8 +327,12 @@ - name: Case 14, the pension-age Housing Benefit and CTR personal allowance applies from the qualifying age. # Born 6 April 1952, over the qualifying age in 2016-17, so the pension-age - # regulations (SI 2006/214) apply. The model's single pension-age rate for - # 2016-17 is 181 a week: 181 x 52 = 9,412. No premiums apply. + # regulations (SI 2006/214) apply. The under-65 single HB allowance is + # 155.60 a week: 155.60 x 52 = 8,091.20. No premiums apply. + # https://www.legislation.gov.uk/uksi/2016/242/regulation/6/made + # CTR shares the higher-category HB parameter: 168.70 x 52 = 8,772.40. + # Its unchanged formula does not select the historical under-65 category; + # the CTR assertion below preserves that approximation, not its legal rate. period: 2016 absolute_error_margin: 0.01 input: @@ -346,8 +350,8 @@ tenure_type: RENT_FROM_COUNCIL output: benefits_premiums: 0 - housing_benefit_applicable_amount: 9_412 - council_tax_reduction_applicable_amount: 9_412 + housing_benefit_applicable_amount: 8_091.20 + council_tax_reduction_applicable_amount: 8_772.40 - name: Case 15, below the qualifying age the working-age allowance for a single person aged 25 or over applies. # Born 6 September 1953, under the qualifying age in 2017-18: 73.10 a week, From 23182a190cc1a73fd7ebf6f3c1925115f9242647 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 23 Oct 2026 15:24:56 -0400 Subject: [PATCH 4/5] End Northern Ireland's under-65 HB category on 6 December 2018 SR 2017/242 reg 7(7) omits the under-65 rows of the Schedule 4 para 1 personal allowance table from 6 December 2018 (reg 1(2)(b)), as SI 2017/1187 does in Great Britain. The NI age limits used 1 April 2019, from the 2019 up-rating table. Correct the three NI dates, citations and descriptions and the formula comment, and pin both jurisdictions' end date in a parameter test. Annual parameters are sampled at 30 April, so no annual result changes. Co-Authored-By: Claude Opus 5.5 --- .../allowances/couple/aged.yaml | 2 +- .../allowances/couple/aged_under_65.yaml | 12 ++++-- .../allowances/lone_parent/aged.yaml | 2 +- .../allowances/lone_parent/aged_under_65.yaml | 12 ++++-- .../allowances/single/aged.yaml | 2 +- .../allowances/single/aged_under_65.yaml | 12 ++++-- .../tests/test_hb_under_65_category_dates.py | 41 +++++++++++++++++++ .../housing_benefit_applicable_amount.py | 9 ++-- 8 files changed, 73 insertions(+), 19 deletions(-) create mode 100644 policyengine_uk/tests/test_hb_under_65_category_dates.py diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged.yaml index 161adbebda..e881640d7b 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged.yaml @@ -1,4 +1,4 @@ -description: Personal allowance for Housing Benefit for a couple where one or both members attained State Pension age before 1 April 2021 (before that date, every couple with a member over State Pension age except, until December 2018 in Great Britain and April 2019 in Northern Ireland, one where both members were under 65). +description: Personal allowance for Housing Benefit for a couple where one or both members attained State Pension age before 1 April 2021 (before that date, every couple with a member over State Pension age except, until 6 December 2018, one where both members were under 65). values: # 2015-16 to 2019-20: the rate set by the instrument cited at each value # (to 2018-19, the aged-65-or-over rate; younger claimants got diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged_under_65.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged_under_65.yaml index 5c8593ce8a..ec1c40ec94 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged_under_65.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/couple/aged_under_65.yaml @@ -47,14 +47,18 @@ age_limit_great_britain: unit: year label: Historical lower GB pensioner allowance age limit age_limit_northern_ireland: - description: Upper age boundary for the former NI pensioner allowance category; zero in the April 2019 replacement table. + description: Upper age boundary for the former NI pensioner allowance category; zero after its removal. values: 2015-04-01: 65 - 2019-04-01: + # SR 2017/242 reg 7(7) omits paragraph (a) of entries (1) and (2), and entry + # (3), from the Schedule 4 para 1 table, from 6 December 2018 (reg 1(2)(b)), + # as SI 2017/1187 does in Great Britain. The 2019 up-rating table (SR 2019/58) + # no longer has the category. + 2018-12-06: value: 0 reference: - - title: NI Social Security Benefits Up-rating Order 2019, articles 1 and 24 and Schedule 4 - href: https://www.legislation.gov.uk/nisr/2019/58/made + - title: Social Security (Miscellaneous Amendments No. 3) Regulations (Northern Ireland) 2017, regulations 1(2)(b) and 7(7) + href: https://www.legislation.gov.uk/nisr/2017/242/made metadata: unit: year label: Historical lower NI pensioner allowance age limit diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged.yaml index 785b63253a..703c00fbf0 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged.yaml @@ -1,4 +1,4 @@ -description: Personal allowance for Housing Benefit for a lone parent who attained State Pension age before 1 April 2021 (before that date, every pension-age lone parent except, until December 2018 in Great Britain and April 2019 in Northern Ireland, one under 65). +description: Personal allowance for Housing Benefit for a lone parent who attained State Pension age before 1 April 2021 (before that date, every pension-age lone parent except, until 6 December 2018, one under 65). values: # 2015-16 to 2019-20: the rate set by the instrument cited at each value diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged_under_65.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged_under_65.yaml index db22f430f7..031a73392f 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged_under_65.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged_under_65.yaml @@ -47,14 +47,18 @@ age_limit_great_britain: unit: year label: Historical lower GB pensioner allowance age limit age_limit_northern_ireland: - description: Upper age boundary for the former NI pensioner allowance category; zero in the April 2019 replacement table. + description: Upper age boundary for the former NI pensioner allowance category; zero after its removal. values: 2015-04-01: 65 - 2019-04-01: + # SR 2017/242 reg 7(7) omits paragraph (a) of entries (1) and (2), and entry + # (3), from the Schedule 4 para 1 table, from 6 December 2018 (reg 1(2)(b)), + # as SI 2017/1187 does in Great Britain. The 2019 up-rating table (SR 2019/58) + # no longer has the category. + 2018-12-06: value: 0 reference: - - title: NI Social Security Benefits Up-rating Order 2019, articles 1 and 24 and Schedule 4 - href: https://www.legislation.gov.uk/nisr/2019/58/made + - title: Social Security (Miscellaneous Amendments No. 3) Regulations (Northern Ireland) 2017, regulations 1(2)(b) and 7(7) + href: https://www.legislation.gov.uk/nisr/2017/242/made metadata: unit: year label: Historical lower NI pensioner allowance age limit diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged.yaml index ec466ee6b5..61942d3d50 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged.yaml @@ -1,4 +1,4 @@ -description: Personal allowance for Housing Benefit for a single claimant who attained State Pension age before 1 April 2021 (before that date, every single pension-age claimant except, until December 2018 in Great Britain and April 2019 in Northern Ireland, one under 65). +description: Personal allowance for Housing Benefit for a single claimant who attained State Pension age before 1 April 2021 (before that date, every single pension-age claimant except, until 6 December 2018, one under 65). values: # 2015-16 to 2019-20: the rate set by the instrument cited at each value # (to 2018-19, the aged-65-or-over rate; younger claimants got diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged_under_65.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged_under_65.yaml index 87a48c15eb..aa53d4e4b4 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged_under_65.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged_under_65.yaml @@ -47,14 +47,18 @@ age_limit_great_britain: unit: year label: Historical lower GB pensioner allowance age limit age_limit_northern_ireland: - description: Upper age boundary for the former NI pensioner allowance category; zero in the April 2019 replacement table. + description: Upper age boundary for the former NI pensioner allowance category; zero after its removal. values: 2015-04-01: 65 - 2019-04-01: + # SR 2017/242 reg 7(7) omits paragraph (a) of entries (1) and (2), and entry + # (3), from the Schedule 4 para 1 table, from 6 December 2018 (reg 1(2)(b)), + # as SI 2017/1187 does in Great Britain. The 2019 up-rating table (SR 2019/58) + # no longer has the category. + 2018-12-06: value: 0 reference: - - title: NI Social Security Benefits Up-rating Order 2019, articles 1 and 24 and Schedule 4 - href: https://www.legislation.gov.uk/nisr/2019/58/made + - title: Social Security (Miscellaneous Amendments No. 3) Regulations (Northern Ireland) 2017, regulations 1(2)(b) and 7(7) + href: https://www.legislation.gov.uk/nisr/2017/242/made metadata: unit: year label: Historical lower NI pensioner allowance age limit diff --git a/policyengine_uk/tests/test_hb_under_65_category_dates.py b/policyengine_uk/tests/test_hb_under_65_category_dates.py new file mode 100644 index 0000000000..6dfc93a330 --- /dev/null +++ b/policyengine_uk/tests/test_hb_under_65_category_dates.py @@ -0,0 +1,41 @@ +"""The historical under-65 pension-age Housing Benefit category ends on the same +day in both jurisdictions. + +Great Britain: SI 2017/1187 regs 1(2)(b) and 7(7). Northern Ireland: SR 2017/242 +regs 1(2)(b) and 7(7). Each removes the under-65 rows of the personal allowance +table from 6 December 2018. The model samples annual parameters at 30 April, so +the date moves no annual result; this test pins the statutory dates in the +parameter files. +""" + +import datetime +from pathlib import Path + +import pytest +import yaml + +ALLOWANCES = ( + Path(__file__).parents[1] + / "parameters" + / "gov" + / "dwp" + / "housing_benefit" + / "allowances" +) +END = datetime.date(2018, 12, 6) + + +@pytest.mark.parametrize("category", ["single", "couple", "lone_parent"]) +@pytest.mark.parametrize( + "jurisdiction, instrument", + [("great_britain", "uksi/2017/1187"), ("northern_ireland", "nisr/2017/242")], +) +def test_under_65_category_ends_on_6_december_2018(category, jurisdiction, instrument): + data = yaml.safe_load((ALLOWANCES / category / "aged_under_65.yaml").read_text()) + values = data[f"age_limit_{jurisdiction}"]["values"] + dates = sorted(values) + assert dates[-1] == END + assert values[dates[-2]] == 65 + end = values[END] + assert end["value"] == 0 + assert any(instrument in reference["href"] for reference in end["reference"]) diff --git a/policyengine_uk/variables/gov/dwp/housing_benefit/housing_benefit_applicable_amount.py b/policyengine_uk/variables/gov/dwp/housing_benefit/housing_benefit_applicable_amount.py index 3ab2fe839a..416a118189 100644 --- a/policyengine_uk/variables/gov/dwp/housing_benefit/housing_benefit_applicable_amount.py +++ b/policyengine_uk/variables/gov/dwp/housing_benefit/housing_benefit_applicable_amount.py @@ -13,6 +13,7 @@ class housing_benefit_applicable_amount(Variable): "https://www.legislation.gov.uk/uksi/2006/214/schedule/3", "https://www.legislation.gov.uk/uksi/2017/1187/regulation/7", "https://www.legislation.gov.uk/nisr/2019/58/schedule/4/made", + "https://www.legislation.gov.uk/nisr/2017/242/regulation/7/made", ) def formula(benunit, period, parameters): @@ -37,10 +38,10 @@ def formula(benunit, period, parameters): northern_ireland = country == country.possible_values.NORTHERN_IRELAND def higher_allowance(category): - # Until 6 December 2018 (GB, SI 2017/1187 reg 7(7)) and 1 April - # 2019 (NI, SR 2019/58 Sch 4), units where the claimant and any - # partner were under 65 got the lower para 1(1)(a) and (2)(a) - # rates. Read at the existing 30-April fiscal-year convention, with + # Until 6 December 2018 (GB, SI 2017/1187 regs 1(2)(b) and 7(7); + # NI, SR 2017/242 regs 1(2)(b) and 7(7)), units where the claimant + # and any partner were under 65 got the lower para 1(1)(a) and + # (2)(a) rates. Read at the existing 30-April fiscal-year convention, with # no new claimant-history input. A zero reform of the lower amount # stays zero rather than falling back to the higher rate. lower = category.aged_under_65 From 3dc9fa22087fa3d4c5537454074221094a716a82 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 24 Oct 2026 18:04:10 -0400 Subject: [PATCH 5/5] Expect the under-65 HB rate for a 40-year-old in 2015 main's 3a37c76ee added test_omitted_age_component_keeps_existing_higher_allowance, which expects the higher pension-age rate in 2015 and 2020 and notes that the historical rate repair is #2207. This branch is that repair: until 6 December 2018 Housing Benefit paid pension-age claimants under 65 the former under-65 rate (SI 2006/214 Sch 3 para 1(1)(a); ended by SI 2017/1187). With no age input the claimant is 40, so in 2015 the pre-cutoff route now gives that rate. England's pensioner Council Tax Reduction has no such category in the model and keeps the higher rate. The test now derives the Housing Benefit rate from the parameters and asserts that the 2015 case uses the lower under-65 amount. Co-Authored-By: Claude Opus 5.5 --- ...est_housing_benefit_pension_age_cohorts.py | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/policyengine_uk/tests/test_housing_benefit_pension_age_cohorts.py b/policyengine_uk/tests/test_housing_benefit_pension_age_cohorts.py index 404325191b..70ea5d5f38 100644 --- a/policyengine_uk/tests/test_housing_benefit_pension_age_cohorts.py +++ b/policyengine_uk/tests/test_housing_benefit_pension_age_cohorts.py @@ -448,15 +448,26 @@ def test_omitted_age_component_keeps_existing_higher_allowance(year): ) for variable in COHORT_VARIABLES: assert bool(sim.calculate(variable, year)[0]) is True - higher = sim.tax_benefit_system.parameters( + single = sim.tax_benefit_system.parameters( str(year) - ).gov.dwp.housing_benefit.allowances.single.aged - # 2015 uses the existing model rate symbolically; historical rate repair is #2207. - for variable in [ - "housing_benefit_applicable_amount", - "council_tax_reduction_applicable_amount", - ]: - assert sim.calculate(variable, year)[0] == pytest.approx(higher * 52, abs=0.01) + ).gov.dwp.housing_benefit.allowances.single + higher = single.aged + # With no age input the claimant is 40. Until 6 December 2018 Housing + # Benefit paid pension-age claimants under 65 the former under-65 rate + # (SI 2006/214 Sch 3 para 1(1)(a); ended by SI 2017/1187), so in 2015 the + # pre-cutoff route gives that rate. England's pensioner Council Tax + # Reduction has no such category in the model and keeps the higher rate. + age = sim.calculate("age", year)[0] + under_65 = single.aged_under_65 + hb_rate = under_65.amount if age < under_65.age_limit_great_britain else higher + expected = { + "housing_benefit_applicable_amount": hb_rate, + "council_tax_reduction_applicable_amount": higher, + } + if year == 2015: + assert hb_rate == under_65.amount < higher + for variable, rate in expected.items(): + assert sim.calculate(variable, year)[0] == pytest.approx(rate * 52, abs=0.01) @pytest.mark.parametrize("region", ["SCOTLAND", "WALES", "NORTHERN_IRELAND"])