File tree Expand file tree Collapse file tree 3 files changed +32
-15
lines changed
Expand file tree Collapse file tree 3 files changed +32
-15
lines changed Original file line number Diff line number Diff line change 1+ Fixed ` gov.contrib.cec.state_pension_increase ` so state pension reforms affect microsimulation outputs and budget impacts.
Original file line number Diff line number Diff line change @@ -23,10 +23,27 @@ def reform_halved():
2323 )
2424
2525
26+ @pytest .fixture (scope = "module" )
27+ def reform_relative_cut ():
28+ return Microsimulation (reform = {"gov.contrib.cec.state_pension_increase" : - 0.1 })
29+
30+
2631@pytest .mark .microsimulation
2732def test_basic_state_pension_responds_to_reform (baseline , reform_halved ):
2833 baseline_total = baseline .calculate ("basic_state_pension" , YEAR ).sum ()
2934 reform_total = reform_halved .calculate ("basic_state_pension" , YEAR ).sum ()
3035
3136 assert baseline_total > 0
3237 assert reform_total < baseline_total * 0.9
38+
39+
40+ @pytest .mark .microsimulation
41+ def test_relative_state_pension_reform_affects_budget (baseline , reform_relative_cut ):
42+ baseline_total = baseline .calculate ("state_pension" , YEAR ).sum ()
43+ reform_total = reform_relative_cut .calculate ("state_pension" , YEAR ).sum ()
44+ baseline_balance = baseline .calculate ("gov_balance" , YEAR ).sum ()
45+ reform_balance = reform_relative_cut .calculate ("gov_balance" , YEAR ).sum ()
46+
47+ assert baseline_total > 0
48+ assert reform_total < baseline_total * 0.95
49+ assert reform_balance > baseline_balance
Original file line number Diff line number Diff line change @@ -12,20 +12,19 @@ class state_pension(Variable):
1212 uprating = "gov.economic_assumptions.indices.obr.consumer_price_index"
1313
1414 def formula (person , period , parameters ):
15- gov = parameters ( period ) .gov
16- if gov . contrib .abolish_state_pension :
15+ contrib = parameters .gov . contrib
16+ if contrib .abolish_state_pension ( period ) :
1717 return 0
18- relative_increase = gov .contrib .cec .state_pension_increase
19- uprating = 1 + relative_increase
20- sp = gov .dwp .state_pension
21- gender = person ("gender" , period ).decode_to_str ()
22- is_sp_age = person ("is_SP_age" , period )
23- return add (
24- person ,
25- period ,
26- [
27- "basic_state_pension" ,
28- "additional_state_pension" ,
29- "new_state_pension" ,
30- ],
18+ uprating = 1 + contrib .cec .state_pension_increase (period )
19+ return (
20+ add (
21+ person ,
22+ period ,
23+ [
24+ "basic_state_pension" ,
25+ "additional_state_pension" ,
26+ "new_state_pension" ,
27+ ],
28+ )
29+ * uprating
3130 )
You can’t perform that action at this time.
0 commit comments