2828
2929date_format = '%Y-%m-%d'
3030legal_name = 'Test name request'
31- validate_active_cao_path = 'legal_api.services.filings.validations.amalgamation_out.validate_active_cao'
3231
3332
3433def _create_consent_amalgamation_out (business , foreign_jurisdiction , effective_date = datetime .utcnow ()):
@@ -55,7 +54,7 @@ def _create_consent_amalgamation_out(business, foreign_jurisdiction, effective_d
5554 'test_name, expected_code, message' ,
5655 [
5756 ('FAIL_IN_FUTURE' , HTTPStatus .BAD_REQUEST , 'Amalgamation out date must be today or past.' ),
58- ('FAIL_NO_CAO ' , HTTPStatus . BAD_REQUEST , 'No active consent amalgamation out for this date and/or jurisdiction.' ),
57+ ('SUCCESS_NO_CAO ' , None , None ),
5958 ('SUCCESS' , None , None )
6059 ]
6160)
@@ -76,7 +75,7 @@ def test_validate_amalgamation_out_date(session, test_name, expected_code, messa
7675 if test_name == 'FAIL_IN_FUTURE' :
7776 filing ['filing' ]['amalgamationOut' ]['amalgamationOutDate' ] = \
7877 (LegislationDatetime .now () + datedelta .datedelta (days = 1 )).strftime (date_format )
79- elif test_name == 'FAIL_NO_CAO ' :
78+ elif test_name == 'SUCCESS_NO_CAO ' :
8079 effective_date -= datedelta .datedelta (months = 6 , days = 1 )
8180
8281 _create_consent_amalgamation_out (business ,
@@ -85,7 +84,7 @@ def test_validate_amalgamation_out_date(session, test_name, expected_code, messa
8584 err = validate (business , filing )
8685
8786 # validate outcomes
88- if test_name != 'SUCCESS ' :
87+ if test_name == 'FAIL_IN_FUTURE ' :
8988 assert expected_code == err .code
9089 assert message == err .msg [0 ]['error' ]
9190 else :
@@ -126,7 +125,6 @@ def test_validate_foreign_jurisdiction(session, mocker, test_name, expected_code
126125 filing ['filing' ]['amalgamationOut' ]['foreignJurisdiction' ]['country' ] = 'US'
127126 filing ['filing' ]['amalgamationOut' ]['foreignJurisdiction' ]['region' ] = 'NONE'
128127
129- mocker .patch (validate_active_cao_path , return_value = [])
130128 err = validate (business , filing )
131129
132130 # validate outcomes
@@ -147,7 +145,6 @@ def test_valid_foreign_jurisdiction(session, mocker, monkeypatch):
147145 business = factory_business (identifier = 'BC1234567' , entity_type = 'BC' , founding_date = datetime .utcnow ())
148146 filing = copy .deepcopy (FILING_HEADER )
149147 filing ['filing' ]['header' ]['name' ] = 'amalgamationOut'
150- mocker .patch (validate_active_cao_path , return_value = [])
151148
152149 for country in pycountry .countries :
153150 filing ['filing' ]['amalgamationOut' ] = copy .deepcopy (AMALGAMATION_OUT )
@@ -191,7 +188,6 @@ def test_amalgamation_out_court_order(session, mocker, test_status, file_number,
191188 else :
192189 del filing ['filing' ]['amalgamationOut' ]['courtOrder' ]['fileNumber' ]
193190
194- mocker .patch (validate_active_cao_path , return_value = [])
195191 err = validate (business , filing )
196192
197193 # validate outcomes
0 commit comments