diff --git a/changelog.d/uc-childcare-work-condition.md b/changelog.d/uc-childcare-work-condition.md new file mode 100644 index 000000000..a4c4cee36 --- /dev/null +++ b/changelog.d/uc-childcare-work-condition.md @@ -0,0 +1 @@ +- Fixed Universal Credit childcare work-condition eligibility so couples require all adults to be in work. diff --git a/policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/childcare_element/uc_childcare_work_condition.yaml b/policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/childcare_element/uc_childcare_work_condition.yaml index 5c89574cc..5e88f76b1 100644 --- a/policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/childcare_element/uc_childcare_work_condition.yaml +++ b/policyengine_uk/tests/policy/baseline/finance/benefit/family/universal_credit/childcare_element/uc_childcare_work_condition.yaml @@ -26,7 +26,7 @@ person1: in_work: false is_adult: true - person2: + person2: in_work: true is_adult: false output: @@ -40,10 +40,27 @@ person1: in_work: false is_adult: true - person2: + person2: in_work: true is_adult: true - benunits: + benunits: + benunit: + members: [person1, person2] + output: + uc_childcare_work_condition: false + +- name: Couple, both adults in work + period: 2024 + absolute_error_margin: 0 + input: + people: + person1: + in_work: true + is_adult: true + person2: + in_work: true + is_adult: true + benunits: benunit: members: [person1, person2] output: diff --git a/policyengine_uk/variables/gov/dwp/universal_credit/childcare_element/uc_childcare_work_condition.py b/policyengine_uk/variables/gov/dwp/universal_credit/childcare_element/uc_childcare_work_condition.py index 125198170..b1a0765b1 100644 --- a/policyengine_uk/variables/gov/dwp/universal_credit/childcare_element/uc_childcare_work_condition.py +++ b/policyengine_uk/variables/gov/dwp/universal_credit/childcare_element/uc_childcare_work_condition.py @@ -14,4 +14,5 @@ def formula(benunit, period, parameters): in_work = person("in_work", period) adults_in_work = adult & in_work # Benefit unit must not have any adults not in work. - return benunit.any(adults_in_work) + all_adults_in_work = benunit.all(in_work | ~adult) + return benunit.any(adults_in_work) & all_adults_in_work