From 69d0d25405da0f8f85443ef18209fb8a0b2cd71a Mon Sep 17 00:00:00 2001 From: Arwen Qin <122495122+ArwenQin@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:40:44 -0700 Subject: [PATCH] 23251 - Updated Limited Restoration to Full Approval Type (#3017) --- .../src/legal_api/services/filings/validations/restoration.py | 4 ++-- .../unit/services/filings/validations/test_restoration.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/legal-api/src/legal_api/services/filings/validations/restoration.py b/legal-api/src/legal_api/services/filings/validations/restoration.py index b15165d8b2..fb6528047d 100644 --- a/legal-api/src/legal_api/services/filings/validations/restoration.py +++ b/legal-api/src/legal_api/services/filings/validations/restoration.py @@ -124,8 +124,8 @@ def validate_approval_type(filing: dict, restoration_type: str, limited_restorat msg = [] approval_type = get_str(filing, APPROVAL_TYPE_PATH) if restoration_type in ('limitedRestorationExtension', 'limitedRestorationToFull') and \ - limited_restoration.approval_type != approval_type: - msg.append({'error': f'Must provide approval type with value of {limited_restoration.approval_type}.', + limited_restoration.approval_type == 'courtOrder' and approval_type != 'courtOrder': + msg.append({'error': 'Must provide approval type with value of courtOrder.', 'path': APPROVAL_TYPE_PATH}) return msg diff --git a/legal-api/tests/unit/services/filings/validations/test_restoration.py b/legal-api/tests/unit/services/filings/validations/test_restoration.py index a631458097..765b22dde5 100644 --- a/legal-api/tests/unit/services/filings/validations/test_restoration.py +++ b/legal-api/tests/unit/services/filings/validations/test_restoration.py @@ -246,8 +246,8 @@ def test_validate_expiry_date(session, test_name, restoration_type, delta_date, [ ('FAIL', ['fullRestoration', 'limitedRestoration', 'limitedRestorationExtension', 'limitedRestorationToFull'], ['BC', 'BEN', 'ULC', 'CC'], None, 'courtOrder', HTTPStatus.UNPROCESSABLE_ENTITY, None), - ('FAIL', ['limitedRestorationExtension', 'limitedRestorationToFull'], ['BC', 'BEN', 'ULC', 'CC'], - 'courtOrder', 'registrar', HTTPStatus.BAD_REQUEST, 'Must provide approval type with value of registrar.'), + ('SUCCESS', ['limitedRestorationExtension', 'limitedRestorationToFull'], ['BC', 'BEN', 'ULC', 'CC'], + 'courtOrder', 'registrar', None, None), ('FAIL', ['limitedRestorationExtension', 'limitedRestorationToFull'], ['BC', 'BEN', 'ULC', 'CC'], 'registrar', 'courtOrder', HTTPStatus.BAD_REQUEST, 'Must provide approval type with value of courtOrder.'), ('SUCCESS', ['fullRestoration', 'limitedRestoration', 'limitedRestorationExtension', 'limitedRestorationToFull'],