Skip to content

Commit

Permalink
fix rpt_month_year off by 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimpe committed Sep 28, 2023
1 parent 148535a commit e8d001a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Field(item="3", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7,
required=True, validators=[validators.dateYearIsLargerThan(1998),
validators.quarterIsValid()]),
TransformField(calendar_quarter_to_rpt_month_year(i % 3), item="3A", name='RPT_MONTH_YEAR', type='number',
TransformField(calendar_quarter_to_rpt_month_year((i - 1) % 3), item="3A", name='RPT_MONTH_YEAR', type='number',
startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998),
validators.dateMonthIsValid()]),
Field(item="4", name='TDRS_SECTION_IND', type='string', startIndex=section_ind_index,
Expand Down
4 changes: 2 additions & 2 deletions tdrs-backend/tdpservice/parsers/test/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,8 @@ def test_parse_tanf_section4_file(tanf_section4_file):
first = t7_objs.first()
sixth = t7_objs[5]

assert first.RPT_MONTH_YEAR == 202012
assert sixth.RPT_MONTH_YEAR == 202010
assert first.RPT_MONTH_YEAR == 202011
assert sixth.RPT_MONTH_YEAR == 202012

assert first.TDRS_SECTION_IND == '2'
assert sixth.TDRS_SECTION_IND == '2'
Expand Down

0 comments on commit e8d001a

Please sign in to comment.