diff --git a/changelog.d/uc-capital-income-property-roles.fixed.md b/changelog.d/uc-capital-income-property-roles.fixed.md new file mode 100644 index 0000000000..696d5a7757 --- /dev/null +++ b/changelog.d/uc-capital-income-property-roles.fixed.md @@ -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. diff --git a/policyengine_uk/tests/test_uc_income_from_capital_properties.py b/policyengine_uk/tests/test_uc_income_from_capital_properties.py index 0bc207f5aa..6a2457cad9 100644 --- a/policyengine_uk/tests/test_uc_income_from_capital_properties.py +++ b/policyengine_uk/tests/test_uc_income_from_capital_properties.py @@ -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"] = { @@ -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"] diff --git a/policyengine_uk/tests/test_uc_state_pension_properties.py b/policyengine_uk/tests/test_uc_state_pension_properties.py index 70ee6af404..5e4115bcde 100644 --- a/policyengine_uk/tests/test_uc_state_pension_properties.py +++ b/policyengine_uk/tests/test_uc_state_pension_properties.py @@ -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} @@ -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}"] = {