@@ -423,6 +423,35 @@ def test_rate_set_form(session: Session, dummy_request: Any) -> None:
423423 assert not form .validate ()
424424 assert 'year' not in form .errors
425425
426+ # study rates may have decimal places (e.g. 52.45 / 31.70)
427+ data = {
428+ 'year' : 2026 ,
429+ 'cost_of_living_adjustment' : '1.5' ,
430+ 'plenary_none_president_halfday' : '1000' ,
431+ 'plenary_none_member_halfday' : '900' ,
432+ 'commission_normal_president_initial' : '300' ,
433+ 'commission_normal_president_additional' : '100' ,
434+ 'study_normal_president_halfhour' : '52.45' ,
435+ 'commission_normal_member_initial' : '250' ,
436+ 'commission_normal_member_additional' : '80' ,
437+ 'study_normal_member_halfhour' : '31.70' ,
438+ 'commission_intercantonal_president_halfday' : '500' ,
439+ 'study_intercantonal_president_hour' : '52.45' ,
440+ 'commission_intercantonal_member_halfday' : '450' ,
441+ 'study_intercantonal_member_hour' : '31.70' ,
442+ 'shortest_all_president_halfhour' : '60' ,
443+ 'shortest_all_member_halfhour' : '50' ,
444+ }
445+ form = RateSetForm (DummyPostData (data ))
446+ form .model = collection
447+ form .request = dummy_request
448+ assert form .validate (), form .errors
449+
450+ new_set = collection .add (year = 2026 )
451+ form .populate_obj (new_set )
452+ assert float (new_set .study_normal_president_halfhour ) == 52.45
453+ assert float (new_set .study_normal_member_halfhour ) == 31.70
454+
426455
427456def test_settlement_run_form (session : Session , dummy_request : Any ) -> None :
428457 collection = SettlementRunCollection (session )
0 commit comments