From d0f4b9ecf9db997d9818989b860576c700a65c88 Mon Sep 17 00:00:00 2001 From: Nicolas ROCHE Date: Thu, 2 Nov 2023 11:26:35 +0100 Subject: [PATCH] toulouse-maelis: [tests] add test on school registration error (#82705) --- ...ild_school_pre_registration_soap_error.xml | 13 +++++++++++ tests/test_toulouse_maelis.py | 22 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 tests/data/toulouse_maelis/R_create_child_school_pre_registration_soap_error.xml diff --git a/tests/data/toulouse_maelis/R_create_child_school_pre_registration_soap_error.xml b/tests/data/toulouse_maelis/R_create_child_school_pre_registration_soap_error.xml new file mode 100644 index 00000000..789006e9 --- /dev/null +++ b/tests/data/toulouse_maelis/R_create_child_school_pre_registration_soap_error.xml @@ -0,0 +1,13 @@ + + + + soap:Server + E25 : Cette personne nappartient pas à cette famille + + + E25 : Cette personne nappartient pas à cette famille + + + + + diff --git a/tests/test_toulouse_maelis.py b/tests/test_toulouse_maelis.py index 75dd2b12..65d9c967 100644 --- a/tests/test_toulouse_maelis.py +++ b/tests/test_toulouse_maelis.py @@ -6220,6 +6220,28 @@ def test_create_child_school_pre_registration(family_service, con, app): assert resp.json['data']['subscribeSchoolBean']['isWaitList'] +def test_create_child_school_pre_registration_soap_error(family_service, con, app): + family_service.add_soap_response( + 'preSubscribeSchoolPerim', get_xml_file('R_create_child_school_pre_registration_soap_error.xml') + ) + url = get_endpoint('create-child-school-pre-registration') + resp = app.post_json( + url, + params={ + 'numPerson': '248460', + 'schoolYear': '2023', + 'levelCode': 'CM1', + 'dateSubscribe': '2023-09-01T00:00:00+02:00', + }, + ) + assert resp.json['err'] == 1 + assert resp.json['err_class'] == 'passerelle.utils.soap.SOAPFault' + assert ( + resp.json['err_desc'] + == 'SOAP service at https://example.org/FamilyService?wsdl returned an error "E25 : Cette personne nappartient pas à cette famille"' + ) + + def test_create_child_school_pre_registration_with_exemption(family_service, con, app): family_service.add_soap_response( 'presubscribeSchoolDerog', get_xml_file('R_create_child_school_pre_registration_with_exemption.xml')