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/uc-capital-income-property-roles.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gave the generated adults in the Universal Credit capital-income and State Pension property tests explicit claimant-or-partner roles, so an adult under 20 is no longer presumed to be the other adult's child.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ def situation(units, year, income_scale=1.0, capital_bump=None):
names = []
for j, age in enumerate(unit["ages"]):
name = f"p{i}_{j}"
person = {"age": {year: age}}
# The generated adults are the claimant and partner, as the FRS
# would record them; without this an adult under 20 who is 16 or
# more years younger is presumed to be the other's child.
person = {"age": {year: age}, "is_claimant_or_partner": {year: True}}
if j == 0:
person["employment_income"] = {year: unit["earnings"]}
person["private_pension_income"] = {
Expand All @@ -128,7 +131,7 @@ def situation(units, year, income_scale=1.0, capital_bump=None):
names.append(name)
for k, age in enumerate(unit["children"]):
name = f"c{i}_{k}"
people[name] = {"age": {year: age}}
people[name] = {"age": {year: age}, "is_claimant_or_partner": {year: False}}
names.append(name)
benunit = {"members": names}
reported = unit["reported_capital"]
Expand Down
11 changes: 9 additions & 2 deletions policyengine_uk/tests/test_uc_state_pension_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ def situation(units, year, income_variable="state_pension", pension_bump=0.0):
names = []
for j, age in enumerate(unit["ages"]):
name = f"p{i}_{j}"
person = {"age": {year: age}, "state_pension": {year: 0.0}}
# The generated adults are the claimant and partner (a mixed-age
# couple can include an 18- or 19-year-old partner), as the FRS
# would record them.
person = {
"age": {year: age},
"state_pension": {year: 0.0},
"is_claimant_or_partner": {year: True},
}
if j == 0:
amount = unit["state_pension"] + pension_bump
person[income_variable] = {year: amount}
Expand All @@ -115,7 +122,7 @@ def situation(units, year, income_variable="state_pension", pension_bump=0.0):
names.append(name)
for k, age in enumerate(unit["children"]):
name = f"c{i}_{k}"
people[name] = {"age": {year: age}}
people[name] = {"age": {year: age}, "is_claimant_or_partner": {year: False}}
names.append(name)
benunits[f"b{i}"] = {"members": names}
households[f"h{i}"] = {
Expand Down
Loading