toulouse-maelis: [tests] add test on school registration error (#82705)

This commit is contained in:
Nicolas Roche 2023-11-02 11:26:35 +01:00 committed by Nicolas Roche
parent a7ff9bbc4a
commit d0f4b9ecf9
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,13 @@
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>E25 : Cette personne nappartient pas à cette famille</faultstring>
<detail>
<ns1:MaelisFamilyException xmlns:ns1="family.ws.maelis.sigec.com">
<message xmlns:ns2="family.ws.maelis.sigec.com">E25 : Cette personne nappartient pas à cette famille</message>
</ns1:MaelisFamilyException>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>

View File

@ -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')