diff --git a/changelog.d/claimant-or-partner-documentation.fixed.md b/changelog.d/claimant-or-partner-documentation.fixed.md new file mode 100644 index 0000000000..ed087214ca --- /dev/null +++ b/changelog.d/claimant-or-partner-documentation.fixed.md @@ -0,0 +1 @@ +The rules for `is_claimant_or_partner` now appear in its variable metadata, not only in the class docstring. diff --git a/policyengine_uk/tests/test_claimant_or_partner_documentation.py b/policyengine_uk/tests/test_claimant_or_partner_documentation.py new file mode 100644 index 0000000000..77b7e61013 --- /dev/null +++ b/policyengine_uk/tests/test_claimant_or_partner_documentation.py @@ -0,0 +1,9 @@ +from policyengine_uk import CountryTaxBenefitSystem + + +def test_claimant_or_partner_documentation_reaches_variable_metadata(): + variable = CountryTaxBenefitSystem().get_variable("is_claimant_or_partner") + documentation = (variable.documentation or "").strip() + assert documentation.startswith("The single adult or couple a benefit unit") + assert "SSCBA 1992 s.137(1)" in documentation + assert "Any further adults are neither claimant nor partner." in documentation diff --git a/policyengine_uk/variables/household/demographic/is_claimant_or_partner.py b/policyengine_uk/variables/household/demographic/is_claimant_or_partner.py index 8163855ec5..9582dc180e 100644 --- a/policyengine_uk/variables/household/demographic/is_claimant_or_partner.py +++ b/policyengine_uk/variables/household/demographic/is_claimant_or_partner.py @@ -2,7 +2,8 @@ class is_claimant_or_partner(Variable): - """The single adult or couple a benefit unit is formed around. + documentation = """ + The single adult or couple a benefit unit is formed around. In benefit law this is the claimant and their partner, as opposed to the children and young persons they are responsible for (SSCBA 1992 s.137(1)