diff --git a/tdrs-backend/tdpservice/parsers/validators/test/test_category3.py b/tdrs-backend/tdpservice/parsers/validators/test/test_category3.py index b91269fff..22957c3b3 100644 --- a/tdrs-backend/tdpservice/parsers/validators/test/test_category3.py +++ b/tdrs-backend/tdpservice/parsers/validators/test/test_category3.py @@ -647,14 +647,13 @@ def test_deprecate__WORK_ELIGIBLE_INDICATOR__HOH__AGE(): 'RPT_MONTH_YEAR': '202010', } result = deprecate_call(category3.validate__WORK_ELIGIBLE_INDICATOR__HOH__AGE())(instance, schema) - print(result) - assert result == [ + assert result == ( False, 'T1: Since Item 1 (work eligible indicator) is 11 and Item 3 (Age) is less than 19, ' 'then Item 2 (relationship w/ head of household) must not be 1.', ['WORK_ELIGIBLE_INDICATOR', 'RELATIONSHIP_HOH', 'DATE_OF_BIRTH'], True - ] + ) instance['DATE_OF_BIRTH'] = '19950101' result = category3.validate__WORK_ELIGIBLE_INDICATOR__HOH__AGE()(instance, schema) assert result == (True, None, ['WORK_ELIGIBLE_INDICATOR', 'RELATIONSHIP_HOH', 'DATE_OF_BIRTH'], False) diff --git a/tdrs-backend/tdpservice/parsers/validators/util.py b/tdrs-backend/tdpservice/parsers/validators/util.py index 238b48e24..1a62fcc96 100644 --- a/tdrs-backend/tdpservice/parsers/validators/util.py +++ b/tdrs-backend/tdpservice/parsers/validators/util.py @@ -42,8 +42,10 @@ def wrapper(*args, **kwargs): def deprecated_validator(*args, **kwargs): make_val = validator(*wrapper_args, **wrapper_kwargs) - is_valid, error, _ = make_val(*args, **kwargs) - return (is_valid, error, True) + result = [] + result.extend(make_val(*args, **kwargs)) + result[-1] = True + return tuple(result) return deprecated_validator return wrapper @@ -55,10 +57,10 @@ def deprecate_call(validator): `deprecate_call(category1.recordHasLengthBetween(117, 156))`. """ def deprecated_validator(*args, **kwargs): - ret = [] - ret.extend(validator(*args, **kwargs)) - ret[-1] = True - return ret + result = [] + result.extend(validator(*args, **kwargs)) + result[-1] = True + return tuple(result) return deprecated_validator