Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/2878.fixed.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down Expand Up @@ -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
126 changes: 93 additions & 33 deletions policyengine_uk/tests/test_uc_receiving_education_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down Expand Up @@ -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]]
Expand Down Expand Up @@ -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=[
Expand Down Expand Up @@ -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,
),
],
),
]
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand All @@ -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():
Expand Down Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -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
)
Expand Down
Loading
Loading