From 44a721d2ce2f4b54e5c07373d0df8a7d5bd4e1a7 Mon Sep 17 00:00:00 2001 From: EasonPan Date: Tue, 14 Jan 2025 08:11:55 -0800 Subject: [PATCH] 25159 - Update NoW filing not Saving temp_reg for T business (#3170) * set temp_reg to none for T business NoW filing * update unit tests --- .../v2/business/business_filings/business_filings.py | 2 ++ .../unit/resources/v2/test_business_filings/test_filings.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/legal-api/src/legal_api/resources/v2/business/business_filings/business_filings.py b/legal-api/src/legal_api/resources/v2/business/business_filings/business_filings.py index fd43ec46a..0c132207c 100644 --- a/legal-api/src/legal_api/resources/v2/business/business_filings/business_filings.py +++ b/legal-api/src/legal_api/resources/v2/business/business_filings/business_filings.py @@ -633,6 +633,8 @@ def save_filing(client_request: LocalProxy, # pylint: disable=too-many-return-s if filing.filing_type == Filing.FILINGS['noticeOfWithdrawal']['name']: ListFilingResource.link_now_and_withdrawn_filing(filing) + if business_identifier.startswith('T'): + filing.temp_reg = None filing.save() except BusinessException as err: return None, None, {'error': err.error}, err.status_code diff --git a/legal-api/tests/unit/resources/v2/test_business_filings/test_filings.py b/legal-api/tests/unit/resources/v2/test_business_filings/test_filings.py index 9e82abe5e..de5da778f 100644 --- a/legal-api/tests/unit/resources/v2/test_business_filings/test_filings.py +++ b/legal-api/tests/unit/resources/v2/test_business_filings/test_filings.py @@ -1608,8 +1608,8 @@ def test_resubmit_filing_failed(session, client, jwt, filing_status, review_stat ('REGULAR-BUSINESS-DISSOLUTION', 'CBEN', 'dissolution', DISSOLUTION, False) ] ) -def test_notice_of_withdraw_filing(session, client, jwt, test_name, legal_type, filing_type, filing_json, is_temp): - """Assert that notice of withdraw for new business filings can be filed""" +def test_notice_of_withdrawal_filing(session, client, jwt, test_name, legal_type, filing_type, filing_json, is_temp): + """Assert that notice of withdrawal for new business filings can be filed""" today = datetime.utcnow().date() future_effective_date = today + timedelta(days=5) future_effective_date = future_effective_date.isoformat() @@ -1702,3 +1702,5 @@ def test_notice_of_withdraw_filing(session, client, jwt, test_name, legal_type, now_filing = (Filing.find_by_id(rv_draft.json['filing']['header']['filingId'])) assert now_filing.withdrawn_filing_id == withdrawn_filing.id assert now_filing.withdrawal_pending == False + if is_temp: + assert now_filing.temp_reg == None