diff --git a/changelog.d/2878.fixed.md b/changelog.d/2878.fixed.md new file mode 100644 index 0000000000..afdb12377f --- /dev/null +++ b/changelog.d/2878.fixed.md @@ -0,0 +1 @@ +The Universal Credit education protection for a claimant moved off legacy benefits (SI 2014/1230 reg. 60(1); SR 2016/226 reg. 61(1) in Northern Ireland) now needs a full-time course that reg. 12(2) of the Universal Credit Regulations 2013 (in Northern Ireland, of the Universal Credit Regulations (Northern Ireland) 2016) covers: advanced education, or a course with a student loan or grant for maintenance. A young person whom an existing benefit kept outside the qualifying young person definition on the migration day (SI 2014/1230 reg. 28; SR 2016/226 reg. 29), and who was on another full-time course, met the condition that day. The protection doesn't reach them, and the model no longer pays them Universal Credit through it. diff --git a/policyengine_uk/tests/policy/baseline/gov/dwp/universal_credit/uc_receiving_education.yaml b/policyengine_uk/tests/policy/baseline/gov/dwp/universal_credit/uc_receiving_education.yaml index 35386bd3d5..bb32327918 100644 --- a/policyengine_uk/tests/policy/baseline/gov/dwp/universal_credit/uc_receiving_education.yaml +++ b/policyengine_uk/tests/policy/baseline/gov/dwp/universal_credit/uc_receiving_education.yaml @@ -1077,9 +1077,7 @@ # to undertake that course" (SI 2014/1230 reg. 60(1)), so DWP now applies it # to them. Off the course, they don't receive education under reg. 12(2), so # they meet s. 4(1)(d) without an exception. DWP had published no rates for - # 2027 to 2028 by November 2026, so we assert no amount. The model keeps - # uc_is_excepted_from_education_condition true here although DWP no longer - # applies reg. 60(1) to the claimant, so we don't assert it. + # 2027 to 2028 by November 2026, so we assert no amount. period: 2027 input: people: @@ -1099,6 +1097,7 @@ region: NORTH_EAST output: uc_receiving_education: [false] + uc_is_excepted_from_education_condition: [false] meets_uc_education_condition: [true] is_uc_eligible: true @@ -1414,3 +1413,54 @@ uc_receiving_education: [false] is_uc_eligible: true universal_credit: 4_062.96 + +- name: Case 48, the 18-year-old of case 42 without maintenance funding gets no Universal Credit when the model derives the closure. + # Issue 2878. The claimant of case 42 takes a full-time course that is + # neither advanced education nor funded by a student loan or grant, earns + # £9,000 and pays a council rent of £6,000. While they had Working Tax + # Credit they worked at least 16 hours a week and had a disability that put + # them at a disadvantage in getting a job, the only route for a single + # claimant under 25 with no child (Working Tax Credit (Entitlement and + # Maximum Rate) Regulations 2002 reg. 4(1), First variation of the Second + # condition, para. (a), which also needs reg. 9(1)(c)). They hold no + # disability benefit and have no limited capability for work determination. + # On the migration day the Working Tax Credit award still existed, so SI + # 2014/1230 reg. 28 kept them out of the qualifying young person definition, + # and the Universal Credit Regulations 2013 reg. 12(2) doesn't cover their + # course: they met the condition in s. 4(1)(d) that day, so reg. 60(1) + # doesn't reach them. The claim ended the award the day before their + # Universal Credit award would start (reg. 8(2)(a)), so from then they count + # as a qualifying young person and receive education (reg. 12(1A)). No reg. + # 14(1) exception the model applies reaches them, so they fail the condition + # and get no Universal Credit. Under the earlier rule the model excepted + # them and paid 12 x £338.58 + £6,000 - 55% x £9,000 = £5,112.96. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 18 + current_education: POST_SECONDARY + is_in_full_time_education: true + employment_income: 9_000 + working_tax_credit_reported: 1_000 + benunits: + benunit: + members: [person1] + would_claim_uc: false + would_claim_uc_at_legacy_closure: true + households: + household: + members: [person1] + region: NORTH_EAST + tenure_type: RENT_FROM_COUNCIL + rent: 6_000 + output: + claims_uc_at_legacy_closure: true + is_qualifying_young_person_on_uc_migration_day: [false] + is_qualifying_young_person_for_uc_education: [true] + uc_receiving_education: [true] + uc_is_excepted_from_education_condition: [false] + meets_uc_education_condition: [false] + is_uc_eligible: false + universal_credit: 0 diff --git a/policyengine_uk/tests/test_uc_receiving_education_properties.py b/policyengine_uk/tests/test_uc_receiving_education_properties.py index a211977060..64c3c4d3c8 100644 --- a/policyengine_uk/tests/test_uc_receiving_education_properties.py +++ b/policyengine_uk/tests/test_uc_receiving_education_properties.py @@ -69,12 +69,12 @@ report, when the model derives claims_uc_at_legacy_closure and legacy_benefits_closed itself: uc_is_excepted_from_education_condition holds exactly when, that year, they report a legacy benefit whose active parameter -reads false and their family claims at closure; and is_uc_eligible holds for -a full-time degree student exactly when that exception holds, and for anyone -not on a full-time course always. It reads the closure dates from the -parameters. With claims_uc_at_legacy_closure set true, which -test_education_condition_invariants draws in 2019, 2021 and 2024, the model -excepts them in any year. +reads false, their family claims at closure and they are on a full-time +degree; and is_uc_eligible holds for a full-time degree student exactly when +that exception holds, and for anyone not on a full-time course always. It +reads the closure dates from the parameters. With claims_uc_at_legacy_closure +set true, which test_education_condition_invariants draws in 2019, 2021 and +2024, the model excepts a claimant on a course reg. 12(2) covers in any year. """ import json @@ -463,7 +463,7 @@ def reference(case, result): couple_tax_credits_on_migration_day = any( person_of[j].get(name, 0) > 0 for j in couple for name in TAX_CREDITS ) - qyp, qyp_on_migration_day, recv = {}, {}, {} + qyp, qyp_on_migration_day, recv, reg_12_2_course = {}, {}, {}, {} for i, person in person_of.items(): qyp[i] = ( bool( @@ -486,8 +486,11 @@ def reference(case, result): "in_HE", False ) maintenance = person.get("has_education_maintenance_funding", False) - recv[i] = person["is_in_full_time_education"] and ( - advanced or maintenance or qyp[i] + reg_12_2_course[i] = person["is_in_full_time_education"] and ( + advanced or maintenance + ) + recv[i] = reg_12_2_course[i] or ( + person["is_in_full_time_education"] and qyp[i] ) foster = { i: person.get("uc_is_responsible_foster_parent_of_child_under_one", False) @@ -524,10 +527,14 @@ def reference(case, result): and bool(result["has_attained_state_pension_credit_qualifying_age"][i]) and bool(result["is_mixed_age_couple"][f]) ) + # Reg. 60(1) protects a person who fails the condition on the + # migration day "because the person is undertaking a full-time + # course (see regulation 12(2) and 13 ...)". reg_60 = ( in_couple_role and fam["benunit"]["claims_uc_at_legacy_closure"] and not qyp_on_migration_day[i] + and reg_12_2_course[i] ) exc[i] = limb_b or limb_c or limb_d or limb_e or limb_f or reg_60 claimants = [i for i in members if result["is_uc_single_or_joint_claimant"][i]] @@ -643,7 +650,13 @@ def single_family(people, closure=False, **household_inputs): ], ), # SI 2014/1230 reg. 28: an 18-year-old on a non-advanced full-time course - # who reports Housing Benefit, without and with a closure claim. + # who reports Housing Benefit, without and with a closure claim. With the + # claim, reg. 60(1) protects them only with maintenance funding, which + # brings the course within reg. 12(2) (issue 2878). The last is YAML case + # 48's claimant, whose closure claim ends a Working Tax Credit award the + # day before the Universal Credit award starts (reg. 8(2)): unfunded, they + # count as a qualifying young person from the first day, receive + # education, and get no Universal Credit. dict( year=2026, families=[ @@ -673,6 +686,33 @@ def single_family(people, closure=False, **household_inputs): tenure_type="RENT_FROM_COUNCIL", rent=6_000, ), + single_family( + [ + person( + 18, + is_in_full_time_education=True, + current_education="POST_SECONDARY", + housing_benefit_reported=6_000, + ) + ], + closure=True, + tenure_type="RENT_FROM_COUNCIL", + rent=6_000, + ), + single_family( + [ + person( + 18, + is_in_full_time_education=True, + current_education="POST_SECONDARY", + employment_income=9_000, + working_tax_credit_reported=1_000, + ) + ], + closure=True, + tenure_type="RENT_FROM_COUNCIL", + rent=6_000, + ), ], ), ] @@ -888,8 +928,9 @@ def test_education_condition_invariants(case): def test_examples_reach_the_cases(): """The examples exclude the issue's student, apply the couple rule both - ways and send the young Housing Benefit claimants down the ordinary - route, so the invariants run on each outcome. One simulation holds the + ways, send the young Housing Benefit claimants down the ordinary route + and leave YAML case 48's unfunded closure claimant (issue 2878) without + Universal Credit, so the invariants run on each outcome. One simulation holds the four examples, as drawn and under BEFORE.""" assert all(example["year"] == 2026 for example in EXAMPLES) case = dict( @@ -898,9 +939,10 @@ def test_examples_reach_the_cases(): ) drawn, before = run(case, variants=[DRAWN, BEFORE]) # Families: the issue's student; the student couples of EXAMPLES[1]; the - # mixed-age couples of EXAMPLES[2]; the young Housing Benefit claimants. + # mixed-age couples of EXAMPLES[2]; the young claimants of EXAMPLES[3]. np.testing.assert_array_equal( - drawn["is_uc_eligible"], [False, False, True, True, False, True, True] + drawn["is_uc_eligible"], + [False, False, True, True, False, True, True, True, False], ) assert drawn["universal_credit"][0] == 0 assert before["universal_credit"][0] > 0 @@ -909,24 +951,39 @@ def test_examples_reach_the_cases(): drawn["uc_is_excepted_from_education_condition"][1:5], [True, False, True, False], ) - # People 9 and 10: the young Housing Benefit claimants. Each claims + # People 9 to 11: the young Housing Benefit claimants. Each claims # Universal Credit, which ends their own Housing Benefit two weeks after # the award starts (SI 2014/1230 reg. 8(2A)). The UC predicate follows # that claim limb and reads reg. 5(5) only from reported Universal # Credit, so it gives true; the condition reads the status on the first - # day of the award, when the Housing Benefit still runs. - young = slice(9, 11) + # day of the award, when the Housing Benefit still runs. Only the funded + # one undertakes a course reg. 12(2) covers, so only they receive + # education, and the reg. 60(1) protection reaches only them: the third + # met the condition on the migration day (issue 2878). Person 12's claim + # ends their Working Tax Credit the day before the award (reg. 8(2)), so + # on the first day they count as a qualifying young person and receive + # education (reg. 12(1A)). The protection doesn't reach them, as it + # doesn't reach the third, so they fail the condition and get no + # Universal Credit, which main_eligibility (BEFORE) pays them. + young = slice(9, 13) np.testing.assert_array_equal( - drawn["is_qualifying_young_person_for_universal_credit"][young], [True, True] + drawn["is_qualifying_young_person_for_universal_credit"][young], + [True, True, True, True], ) np.testing.assert_array_equal( - drawn["is_qualifying_young_person_for_uc_education"][young], [False, False] + drawn["is_qualifying_young_person_for_uc_education"][young], + [False, False, False, True], ) - np.testing.assert_array_equal(drawn["uc_receiving_education"][young], [False, True]) np.testing.assert_array_equal( - drawn["uc_is_excepted_from_education_condition"][young], [False, True] + drawn["uc_receiving_education"][young], [False, True, False, True] ) - assert np.all(drawn["universal_credit"][5:] > 0) + np.testing.assert_array_equal( + drawn["uc_is_excepted_from_education_condition"][young], + [False, True, False, False], + ) + assert np.all(drawn["universal_credit"][5:8] > 0) + assert drawn["universal_credit"][8] == 0 + assert before["universal_credit"][8] > 0 def test_student_head_moves_non_dependant_to_joint_tenant(): @@ -1095,17 +1152,18 @@ def test_reg_60_protection_follows_the_closure_dates(case): model derives claims_uc_at_legacy_closure and legacy_benefits_closed itself, uc_is_excepted_from_education_condition holds exactly when, in that model year, they report a legacy benefit whose active parameter reads - false and their family claims at closure - (would_claim_uc_at_legacy_closure). None of them meets a reg. 14(1) limb, + false, their family claims at closure (would_claim_uc_at_legacy_closure) + and they are on a full-time degree. None of them meets a reg. 14(1) limb, so the model excepts them only under its reg. 60(1) rule (SR 2016/226 reg. 61(1) in Northern Ireland), and it takes the closure from the active - parameters. The model then finds a full-time degree student among them - eligible for Universal Credit exactly when the exception holds, and anyone - among them not on a full-time course eligible either way. For a person off - a course the model keeps the exception, although DWP lifts the condition - under reg. 60(1), and the Department for Communities under reg. 61(1), - only while they continue the course (case 38 of - uc_receiving_education.yaml); this test pins that proxy.""" + parameters. DWP lifts the condition under reg. 60(1), and the Department + for Communities under reg. 61(1), only for a person who failed it on the + migration day because of a course reg. 12(2) covers and only while they + continue it, so a person off a course has no exception (case 38 of + uc_receiving_education.yaml). The model then finds a full-time degree + student among them eligible for Universal Credit exactly when the + exception holds, and anyone among them not on a full-time course eligible + either way.""" year = case["year"] simulation = Simulation(situation=closure_situation(case)) # The formulas read parameters at 1 January of the model year, and the @@ -1120,7 +1178,10 @@ def closed(path): node = getattr(node, key) return not bool(node) - expected = np.array( + # Each person is on a degree (current_education TERTIARY), so a full-time + # one undertakes a course reg. 12(2)(a) covers. + full_time = np.array([p["is_in_full_time_education"] for p in case["people"]]) + expected = full_time & np.array( [ drawn["would_claim_uc_at_legacy_closure"] and any( @@ -1136,7 +1197,6 @@ def closed(path): expected, context, ) - full_time = np.array([p["is_in_full_time_education"] for p in case["people"]]) np.testing.assert_array_equal( simulation.calculate("is_uc_eligible", year), ~full_time | expected, context ) diff --git a/policyengine_uk/variables/gov/dwp/universal_credit/uc_is_excepted_from_education_condition.py b/policyengine_uk/variables/gov/dwp/universal_credit/uc_is_excepted_from_education_condition.py index 5b42c4658f..71b8d87e26 100644 --- a/policyengine_uk/variables/gov/dwp/universal_credit/uc_is_excepted_from_education_condition.py +++ b/policyengine_uk/variables/gov/dwp/universal_credit/uc_is_excepted_from_education_condition.py @@ -1,4 +1,7 @@ from policyengine_uk.model_api import * +from policyengine_uk.variables.gov.dwp.universal_credit.uc_receiving_education import ( + undertakes_regulation_12_2_course, +) class uc_is_excepted_from_education_condition(Variable): @@ -21,13 +24,34 @@ class uc_is_excepted_from_education_condition(Variable): "qualifying age for State Pension Credit; and reg. 60(1), a member of " "a family that claims Universal Credit when DWP moves it off its " "legacy benefits (claims_uc_at_legacy_closure), which the model takes " - "as the qualifying claim under reg. 48 of the 2014 Regulations, and who " + "as the qualifying claim under reg. 48 of the 2014 Regulations, who " "didn't count as a qualifying young person for the condition on the " "migration day (is_qualifying_young_person_on_uc_migration_day, which " "applies reg. 28 of the 2014 Regulations to the award the claim " - "ended). The model needs no rule of its own for limb " - "(e)(i): it places responsibility for a child on the benefit unit, so " - "both members of the couple meet (c). Under (b), the decision maker " + "ended), and who undertakes a full-time course that reg. 12(2) of the " + "2013 Regulations covers: advanced education, or a course with a " + "student loan or grant for their maintenance. Reg. 60(1) protects only " + "a person who fails the condition on the migration day because of such " + "a course, and only while they continue it; the model reads the " + "model year's course inputs for both, so a person who leaves the " + "course loses the protection that year, but a person who starts a " + "course reg. 12(2) covers after the migration day, or moves to " + "another such course, has it that year, which the law doesn't give. " + "A young person whom reg. 28 alone kept outside the definition on the " + "migration day, on a course reg. 12(2) doesn't cover, met the " + "condition that day, so reg. 60(1) doesn't reach them. Where the " + "claim ends that existing benefit before the award starts (a tax " + "credit, reg. 8(2) of the 2014 Regulations), they count as a " + "qualifying young person from the first day and receive education " + "(reg. 12(1A)). Where it runs on past the first day (Income Support " + "or Housing Benefit under reg. 8(2A), or income-related ESA under SI " + "2019/1152 reg. 5), reg. 28 still excludes them that day, so they " + "meet the condition, and reg. 5(5) of the 2013 Regulations then keeps " + "them outside the definition while they receive Universal Credit " + "(is_qualifying_young_person_for_uc_education). The model needs no rule of " + "its own for limb (e)(i): it places responsibility for a child on the " + "benefit unit, so both members of the couple meet (c). Under (b), the " + "decision maker " "must determine limited capability for work before the course starts. " "The model can derive uc_limited_capability_for_work from disability " "status (is_disabled_for_benefits) without an assessment, so it can " @@ -51,21 +75,34 @@ class uc_is_excepted_from_education_condition(Variable): "placed, and for a friend or family carer, who is responsible for the " "child and so meets (c) under the law. In Northern Ireland the " "decision maker applies the same exceptions under reg. 14(1) of the " - "Universal Credit Regulations (Northern Ireland) 2016, and the same " - "protection under reg. 61 of the Universal Credit (Transitional " - "Provisions) Regulations (Northern Ireland) 2016, with regs. 29 and 49 " - "of those Regulations in place of regs. 28 and 48; the model doesn't " - "apply reg. 61(2) either." + "Universal Credit Regulations (Northern Ireland) 2016, with regs. 6 " + "and 12(1) of those Regulations in place of regs. 5 and 12(1A), and " + "the same protection under reg. 61 of the Universal Credit " + "(Transitional Provisions) Regulations (Northern Ireland) 2016, with " + "regs. 6, 29 and 49 of " + "those Regulations in place of regs. 8, 28 and 48: a claim ends a " + "rate rebate before the award starts (reg. 6(2)), and a rent rebate " + "or allowance runs on (reg. 6(2A)), as income-related ESA does under " + "SR 2019/152 reg. 4 in place of SI 2019/1152 reg. 5. The model " + "doesn't apply reg. 61(2) either." ) definition_period = YEAR reference = ( "https://www.legislation.gov.uk/uksi/2013/376/regulation/14", "https://www.legislation.gov.uk/uksi/2013/376/regulation/2", + "https://www.legislation.gov.uk/uksi/2013/376/regulation/5", + "https://www.legislation.gov.uk/uksi/2013/376/regulation/12", + "https://www.legislation.gov.uk/uksi/2014/1230/regulation/8", + "https://www.legislation.gov.uk/uksi/2019/1152/regulation/5", "https://www.legislation.gov.uk/uksi/2014/1230/regulation/28", "https://www.legislation.gov.uk/uksi/2014/1230/regulation/48", "https://www.legislation.gov.uk/uksi/2014/1230/regulation/49", "https://www.legislation.gov.uk/uksi/2014/1230/regulation/60", + "https://www.legislation.gov.uk/nisr/2016/216/regulation/6", + "https://www.legislation.gov.uk/nisr/2016/216/regulation/12", "https://www.legislation.gov.uk/nisr/2016/216/regulation/14", + "https://www.legislation.gov.uk/nisr/2016/226/regulation/6", + "https://www.legislation.gov.uk/nisr/2019/152/regulation/4", "https://www.legislation.gov.uk/nisr/2016/226/regulation/29", "https://www.legislation.gov.uk/nisr/2016/226/regulation/49", "https://www.legislation.gov.uk/nisr/2016/226/regulation/61", @@ -130,11 +167,14 @@ def formula(person, period, parameters): # education under reg. 12(1A), not reg. 12(2); reg. 28 applies # first, so a person entitled to an existing benefit on the # migration day took reg. 12(2) and keeps the protection while they - # continue the course, after that award has ended. + # continue the course, after that award has ended. A course reg. + # 12(2) doesn't cover left them meeting the condition that day, so + # the protection needs a course it covers. migrated_student = ( claimant_or_partner & benunit("claims_uc_at_legacy_closure", period) & ~person("is_qualifying_young_person_on_uc_migration_day", period) + & undertakes_regulation_12_2_course(person, period) ) return ( disabled_with_limited_capability_for_work diff --git a/policyengine_uk/variables/gov/dwp/universal_credit/uc_receiving_education.py b/policyengine_uk/variables/gov/dwp/universal_credit/uc_receiving_education.py index c6c546a1e4..e7abd8c8a9 100644 --- a/policyengine_uk/variables/gov/dwp/universal_credit/uc_receiving_education.py +++ b/policyengine_uk/variables/gov/dwp/universal_credit/uc_receiving_education.py @@ -1,6 +1,29 @@ from policyengine_uk.model_api import * +def undertakes_regulation_12_2_course(person, period): + """Whether a person undertakes a course that the Universal Credit + Regulations 2013 reg. 12(2) covers: a full-time course of advanced + education (reg. 12(2)(a)), or another full-time course of study or + training with a student loan or grant for their maintenance (reg. + 12(2)(b)).""" + full_time = person("is_in_full_time_education", period) + # Reg. 12(3): a course leading to a degree, DipHE or HND, or "of a + # standard above a general certificate of education (advanced + # level), or above a Scottish national qualification (higher or + # advanced higher)". + education = person("current_education", period) + advanced = (education == education.possible_values.TERTIARY) | person( + "in_HE", period + ) + # Reg. 12(2)(b): "any other full-time course of study or training at + # an educational establishment for which a student loan or grant is + # provided for the person's maintenance" (reg. 2 takes both terms + # from reg. 68(7)). + maintenance_funding = person("has_education_maintenance_funding", period) + return full_time & (advanced | maintenance_funding) + + class uc_receiving_education(Variable): value_type = bool entity = Person @@ -46,19 +69,6 @@ class uc_receiving_education(Variable): def formula(person, period, parameters): full_time = person("is_in_full_time_education", period) - # Reg. 12(3): a course leading to a degree, DipHE or HND, or "of a - # standard above a general certificate of education (advanced - # level), or above a Scottish national qualification (higher or - # advanced higher)". - education = person("current_education", period) - advanced = (education == education.possible_values.TERTIARY) | person( - "in_HE", period - ) - # Reg. 12(2)(b): "any other full-time course of study or training at - # an educational establishment for which a student loan or grant is - # provided for the person's maintenance" (reg. 2 takes both terms - # from reg. 68(7)). - maintenance_funding = person("has_education_maintenance_funding", period) # Reg. 12(1A): "A qualifying young person is to be treated as # receiving education", whatever the course. SI 2014/1230 reg. 28 # applies first, so a person entitled to an existing benefit takes @@ -66,4 +76,6 @@ def formula(person, period, parameters): qualifying_young_person = person( "is_qualifying_young_person_for_uc_education", period ) - return full_time & (advanced | maintenance_funding | qualifying_young_person) + return undertakes_regulation_12_2_course(person, period) | ( + full_time & qualifying_young_person + )