2929
3030date_format = '%Y-%m-%d'
3131legal_name = 'Test name request'
32- validate_active_cco_path = 'legal_api.services.filings.validations.continuation_out.validate_active_cco'
3332
3433
3534def _create_consent_continuation_out (business , foreign_jurisdiction , effective_date = datetime .utcnow ()):
@@ -56,7 +55,7 @@ def _create_consent_continuation_out(business, foreign_jurisdiction, effective_d
5655 'test_name, expected_code, message' ,
5756 [
5857 ('FAIL_IN_FUTURE' , HTTPStatus .BAD_REQUEST , 'Continuation out date must be today or past.' ),
59- ('FAIL_NO_CCO ' , HTTPStatus . BAD_REQUEST , 'No active consent continuation out for this date and/or jurisdiction.' ),
58+ ('SUCCESS_NO_CCO ' , None , None ),
6059 ('SUCCESS' , None , None )
6160 ]
6261)
@@ -77,7 +76,7 @@ def test_validate_continuation_out_date(session, test_name, expected_code, messa
7776 if test_name == 'FAIL_IN_FUTURE' :
7877 filing ['filing' ]['continuationOut' ]['continuationOutDate' ] = \
7978 (LegislationDatetime .now () + datedelta .datedelta (days = 1 )).strftime (date_format )
80- elif test_name == 'FAIL_NO_CCO ' :
79+ elif test_name == 'SUCCESS_NO_CCO ' :
8180 effective_date -= datedelta .datedelta (months = 6 , days = 1 )
8281
8382 _create_consent_continuation_out (business ,
@@ -86,7 +85,7 @@ def test_validate_continuation_out_date(session, test_name, expected_code, messa
8685 err = validate (business , filing )
8786
8887 # validate outcomes
89- if test_name != 'SUCCESS ' :
88+ if test_name == 'FAIL_IN_FUTURE ' :
9089 assert expected_code == err .code
9190 assert message == err .msg [0 ]['error' ]
9291 else :
@@ -127,7 +126,6 @@ def test_validate_foreign_jurisdiction(session, mocker, test_name, expected_code
127126 filing ['filing' ]['continuationOut' ]['foreignJurisdiction' ]['country' ] = 'US'
128127 filing ['filing' ]['continuationOut' ]['foreignJurisdiction' ]['region' ] = 'NONE'
129128
130- mocker .patch (validate_active_cco_path , return_value = [])
131129 err = validate (business , filing )
132130
133131 # validate outcomes
@@ -148,7 +146,6 @@ def test_valid_foreign_jurisdiction(session, mocker, monkeypatch):
148146 business = factory_business (identifier = 'BC1234567' , entity_type = 'BC' , founding_date = datetime .utcnow ())
149147 filing = copy .deepcopy (FILING_HEADER )
150148 filing ['filing' ]['header' ]['name' ] = 'continuationOut'
151- mocker .patch (validate_active_cco_path , return_value = [])
152149
153150 for country in pycountry .countries :
154151 filing ['filing' ]['continuationOut' ] = copy .deepcopy (CONTINUATION_OUT )
@@ -192,7 +189,6 @@ def test_continuation_out_court_order(session, mocker, test_status, file_number,
192189 else :
193190 del filing ['filing' ]['continuationOut' ]['courtOrder' ]['fileNumber' ]
194191
195- mocker .patch (validate_active_cco_path , return_value = [])
196192 err = validate (business , filing )
197193
198194 # validate outcomes
0 commit comments