toulouse-maelis: FSL removed from Parsifal project (#71387)
gitea-wip/passerelle/pipeline/pr-main This commit looks good
Details
gitea-wip/passerelle/pipeline/pr-main This commit looks good
Details
This commit is contained in:
parent
cd46dc8d97
commit
23d086b6d0
|
@ -180,19 +180,6 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
self.add_text_value('PAI', data, ['paiInfoBean', 'code'])
|
||||
for person in data['authorizedPersonList']:
|
||||
self.add_text_value_to_child_person(person)
|
||||
|
||||
# convert O/N string into boolean
|
||||
if data.get('fsl'):
|
||||
for key in (
|
||||
'allergieAlimentaire',
|
||||
'allergieRespiratoire',
|
||||
'allergieAutre',
|
||||
'allergieMedicament',
|
||||
'asthme',
|
||||
'flPAI',
|
||||
'flImage',
|
||||
):
|
||||
data['fsl'][key] = bool(data['fsl'][key] == 'O')
|
||||
return data
|
||||
|
||||
def add_text_value_to_person(self, data):
|
||||
|
@ -1096,39 +1083,6 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
self.call('Family', 'updateChildPAI', personNumber=child_id, **post_data)
|
||||
return {'data': 'ok'}
|
||||
|
||||
@endpoint(
|
||||
display_category='Famille',
|
||||
description="Créer ou mettre à jour la fiche sanitaire d'un enfant",
|
||||
name='update-child-fsl',
|
||||
perm='can_access',
|
||||
parameters={
|
||||
'NameID': {'description': 'Publik NameID'},
|
||||
'child_id': {'description': "Numéro de l'enfant"},
|
||||
},
|
||||
post={'request_body': {'schema': {'application/json': schemas.FSL_SCHEMA}}},
|
||||
)
|
||||
def update_child_fsl(self, request, NameID, child_id, post_data):
|
||||
self.get_link(NameID)
|
||||
|
||||
# maelis expect strings O/N
|
||||
for key in (
|
||||
'allergieAlimentaire',
|
||||
'allergieRespiratoire',
|
||||
'allergieAutre',
|
||||
'allergieMedicament',
|
||||
'asthme',
|
||||
'flPAI',
|
||||
'flImage',
|
||||
):
|
||||
post_data[key] = 'O' if post_data.get(key) else 'N'
|
||||
|
||||
# use None to empty optional date passed as an empty string by date filter
|
||||
if post_data.get('dtcPrap1') == '':
|
||||
post_data['dtcPrap1'] = None
|
||||
|
||||
self.call('Family', 'createOrUpdateFSL', arg0=child_id, arg1=post_data)
|
||||
return {'data': 'ok'}
|
||||
|
||||
@endpoint(
|
||||
display_category='Famille',
|
||||
description="Créer ou mettre à jour les données médicales d'un enfant",
|
||||
|
|
|
@ -246,103 +246,6 @@ CHILDBIRTH_SCHEMA = {
|
|||
},
|
||||
}
|
||||
|
||||
FSL_SCHEMA = {
|
||||
'$schema': 'http://json-schema.org/draft-04/schema#',
|
||||
'title': 'FSL',
|
||||
'description': 'Informations sur la fiche sanitaire',
|
||||
'type': 'object',
|
||||
'properties': {
|
||||
'dateDeb': {
|
||||
'description': 'Date de début',
|
||||
'type': 'string',
|
||||
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
||||
},
|
||||
'dateFin': {
|
||||
'description': 'Date de fin',
|
||||
'type': 'string',
|
||||
'pattern': '^[0-9]{4}-[0-9]{2}-[0-9]{2}$',
|
||||
},
|
||||
'allergieAlimentaire': {
|
||||
'description': 'Allergie alimentaire',
|
||||
'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
|
||||
},
|
||||
'allergieRespiratoire': {
|
||||
'description': 'Allergie respiratoire',
|
||||
'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
|
||||
},
|
||||
'allergieAutre': {
|
||||
'description': 'Allergie autre',
|
||||
'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
|
||||
},
|
||||
'allergieMedicament': {
|
||||
'description': 'Allergie médicament',
|
||||
'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
|
||||
},
|
||||
'asthme': {
|
||||
'description': 'Asthmatique',
|
||||
'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
|
||||
},
|
||||
'flPAI': {
|
||||
'description': 'PAI',
|
||||
'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
|
||||
},
|
||||
'flImage': {
|
||||
'description': 'Autorisation photo',
|
||||
'oneOf': BOOLEAN_TYPES + [{'type': 'null'}],
|
||||
},
|
||||
'dtcPrap1': {
|
||||
'description': 'Date du dernier rappel DT Polio',
|
||||
'type': 'string',
|
||||
'pattern': '^([0-9]{4}-[0-9]{2}-[0-9]{2}){0,1}$',
|
||||
},
|
||||
'obsMed1': {
|
||||
'description': 'Observation médecin 1',
|
||||
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
||||
},
|
||||
'obsMed2': {
|
||||
'description': 'Observation médecin 2',
|
||||
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
||||
},
|
||||
'obsMed3': {
|
||||
'description': 'Observation médecin 3',
|
||||
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
||||
},
|
||||
'obsDir1': {
|
||||
'description': 'Observation directeur 1',
|
||||
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
||||
},
|
||||
'obsDir2': {
|
||||
'description': 'Observation directeur 2',
|
||||
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
||||
},
|
||||
'obsDir3': {
|
||||
'description': 'Observation directeur 3',
|
||||
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
||||
},
|
||||
'obsAssist1': {
|
||||
'description': 'Observation assistant sanitaire 1',
|
||||
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
||||
},
|
||||
'obsAssist2': {
|
||||
'description': 'Observation assistant sanitaire 2',
|
||||
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
||||
},
|
||||
'obsAssist3': {
|
||||
'description': 'Observation assistant sanitaire 3',
|
||||
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
||||
},
|
||||
'cons1Med': {
|
||||
'description': 'Conseil médecin 1',
|
||||
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
||||
},
|
||||
'cons2Med': {
|
||||
'description': 'Conseil médecin 2',
|
||||
'oneOf': [{'type': 'string'}, {'type': 'null'}],
|
||||
},
|
||||
},
|
||||
'additionalProperties': False,
|
||||
}
|
||||
|
||||
DOCTORADDRESS_SCHEMA = {
|
||||
'$schema': 'http://json-schema.org/draft-04/schema#',
|
||||
'title': 'Doctor address',
|
||||
|
@ -489,7 +392,6 @@ CHILD_SCHEMA = {
|
|||
'description': 'Autorisation à partir seul',
|
||||
'oneOf': BOOLEAN_TYPES,
|
||||
},
|
||||
'fsl': {'oneOf': [FSL_SCHEMA, {'type': 'null'}]},
|
||||
'medicalRecord': {'oneOf': [MEDICALRECORD_SCHEMA, {'type': 'null'}]},
|
||||
'paiInfoBean': {'oneOf': [PAIINFO_SCHEMA, {'type': 'null'}]},
|
||||
},
|
||||
|
@ -633,7 +535,6 @@ UPDATE_FAMILY_SCHEMA = {
|
|||
CREATE_FAMILY_SCHEMA = copy.deepcopy(UPDATE_FAMILY_SCHEMA)
|
||||
CREATE_FAMILY_SCHEMA['required'] = ['rl1', 'categorie', 'situation']
|
||||
create_family_child_schema = CREATE_FAMILY_SCHEMA['properties']['childList']['oneOf'][0]['items']
|
||||
del create_family_child_schema['properties']['fsl']
|
||||
del create_family_child_schema['properties']['bPhoto']
|
||||
del create_family_child_schema['properties']['bLeaveAlone']
|
||||
del create_family_child_schema['properties']['paiInfoBean']
|
||||
|
@ -665,7 +566,6 @@ UPDATE_RL2_SCHEMA = copy.deepcopy(UPDATE_RL1_SCHEMA)
|
|||
CREATE_CHILD_SCHEMA = copy.deepcopy(CHILD_SCHEMA)
|
||||
CREATE_CHILD_SCHEMA['unflatten'] = True
|
||||
del CREATE_CHILD_SCHEMA['properties']['dietcode']
|
||||
del CREATE_CHILD_SCHEMA['properties']['fsl']
|
||||
del CREATE_CHILD_SCHEMA['properties']['medicalRecord']
|
||||
del CREATE_CHILD_SCHEMA['properties']['paiInfoBean']
|
||||
|
||||
|
|
|
@ -802,7 +802,6 @@
|
|||
<xs:element name="sexe" type="xs:string"/>
|
||||
<xs:element name="birth" type="tns:birthInfoBean"/>
|
||||
<xs:element minOccurs="0" name="dietcode" type="xs:string"/>
|
||||
<xs:element minOccurs="0" name="fsl" type="ns1:fslBean"/>
|
||||
<xs:element minOccurs="0" name="bPhoto" type="xs:boolean"/>
|
||||
<xs:element minOccurs="0" name="bLeaveAlone" type="xs:boolean"/>
|
||||
<xs:element maxOccurs="unbounded" minOccurs="0" name="authorizedPersonList" nillable="true" type="tns:relatedPersonBean"/>
|
||||
|
@ -2724,4 +2723,4 @@ Cette méthode permet de mettre à jour les informations relatives au PAI pour u
|
|||
<soap:address location="https://demo-toulouse.sigec.fr/maelisws-toulouse/services/FamilyService"/>
|
||||
</wsdl:port>
|
||||
</wsdl:service>
|
||||
</wsdl:definitions>
|
||||
</wsdl:definitions>
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
|
||||
<soap-env:Header>
|
||||
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
|
||||
<wsse:UsernameToken>
|
||||
<wsse:Username>maelis-webservice</wsse:Username>
|
||||
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">maelis-password</wsse:Password>
|
||||
</wsse:UsernameToken>
|
||||
</wsse:Security>
|
||||
</soap-env:Header>
|
||||
<soap-env:Body>
|
||||
<ns0:createOrUpdateFSL xmlns:ns0="family.ws.maelis.sigec.com">
|
||||
<arg0>613878</arg0>
|
||||
<arg1>
|
||||
<dateDeb>2022-01-01</dateDeb>
|
||||
<dateFin>2022-12-31</dateFin>
|
||||
<allergieAlimentaire>O</allergieAlimentaire>
|
||||
<allergieRespiratoire>O</allergieRespiratoire>
|
||||
<allergieAutre>O</allergieAutre>
|
||||
<allergieMedicament>O</allergieMedicament>
|
||||
<asthme>N</asthme>
|
||||
<flPAI>N</flPAI>
|
||||
<flImage>N</flImage>
|
||||
<dtcPrap1>2022-02-22</dtcPrap1>
|
||||
<obsMed1>some obsMed1 text</obsMed1>
|
||||
<obsMed2>some obsMed2 text</obsMed2>
|
||||
<obsMed3>some obsMed3 text</obsMed3>
|
||||
<obsDir1>some obsDir1 text</obsDir1>
|
||||
<obsDir2>some obsDir2 text</obsDir2>
|
||||
<obsDir3>some obsDir3 text</obsDir3>
|
||||
<obsAssist1>some obsAssist1 text</obsAssist1>
|
||||
<obsAssist2>some obsAssist2 text</obsAssist2>
|
||||
<obsAssist3>some obsAssist3 text</obsAssist3>
|
||||
<cons1Med>some cons1Med text</cons1Med>
|
||||
<cons2Med>some cons2Med text</cons2Med>
|
||||
</arg1>
|
||||
</ns0:createOrUpdateFSL>
|
||||
</soap-env:Body>
|
||||
</soap-env:Envelope>
|
|
@ -97,29 +97,6 @@
|
|||
<dateBirth>1943-01-19T00:00:00+01:00</dateBirth>
|
||||
</birth>
|
||||
<dietcode>RSV</dietcode>
|
||||
<fsl>
|
||||
<dateDeb>2022-01-01T00:00:00+01:00</dateDeb>
|
||||
<dateFin>2022-12-31T00:00:00+01:00</dateFin>
|
||||
<allergieAlimentaire>O</allergieAlimentaire>
|
||||
<allergieRespiratoire>O</allergieRespiratoire>
|
||||
<allergieAutre>O</allergieAutre>
|
||||
<allergieMedicament>O</allergieMedicament>
|
||||
<asthme>N</asthme>
|
||||
<flPAI>N</flPAI>
|
||||
<flImage>N</flImage>
|
||||
<dtcPrap1>2022-02-22T00:00:00+01:00</dtcPrap1>
|
||||
<obsMed1>some obsMed1 text</obsMed1>
|
||||
<obsMed2>some obsMed2 text</obsMed2>
|
||||
<obsMed3>some obsMed3 text</obsMed3>
|
||||
<obsDir1>some obsDir1 text</obsDir1>
|
||||
<obsDir2>some obsDir2 text</obsDir2>
|
||||
<obsDir3>some obsDir3 text</obsDir3>
|
||||
<obsAssist1>some obsAssist1 text</obsAssist1>
|
||||
<obsAssist2>some obsAssist2 text</obsAssist2>
|
||||
<obsAssist3>some obsAssist3 text</obsAssist3>
|
||||
<cons1Med>some cons1Med text</cons1Med>
|
||||
<cons2Med>some cons2Med text</cons2Med>
|
||||
</fsl>
|
||||
<bPhoto>true</bPhoto>
|
||||
<bLeaveAlone>false</bLeaveAlone>
|
||||
<authorizedPersonList>
|
||||
|
|
|
@ -96,29 +96,6 @@
|
|||
<dateBirth>1943-01-19T00:00:00+01:00</dateBirth>
|
||||
</birth>
|
||||
<dietcode>RSV</dietcode>
|
||||
<fsl>
|
||||
<dateDeb>2022-01-01T00:00:00+01:00</dateDeb>
|
||||
<dateFin>2022-12-31T00:00:00+01:00</dateFin>
|
||||
<allergieAlimentaire>O</allergieAlimentaire>
|
||||
<allergieRespiratoire>O</allergieRespiratoire>
|
||||
<allergieAutre>O</allergieAutre>
|
||||
<allergieMedicament>O</allergieMedicament>
|
||||
<asthme>N</asthme>
|
||||
<flPAI>N</flPAI>
|
||||
<flImage>N</flImage>
|
||||
<dtcPrap1>2022-02-22T00:00:00+01:00</dtcPrap1>
|
||||
<obsMed1>some obsMed1 text</obsMed1>
|
||||
<obsMed2>some obsMed2 text</obsMed2>
|
||||
<obsMed3>some obsMed3 text</obsMed3>
|
||||
<obsDir1>some obsDir1 text</obsDir1>
|
||||
<obsDir2>some obsDir2 text</obsDir2>
|
||||
<obsDir3>some obsDir3 text</obsDir3>
|
||||
<obsAssist1>some obsAssist1 text</obsAssist1>
|
||||
<obsAssist2>some obsAssist2 text</obsAssist2>
|
||||
<obsAssist3>some obsAssist3 text</obsAssist3>
|
||||
<cons1Med>some cons1Med text</cons1Med>
|
||||
<cons2Med>some cons2Med text</cons2Med>
|
||||
</fsl>
|
||||
<bPhoto>true</bPhoto>
|
||||
<bLeaveAlone>false</bLeaveAlone>
|
||||
<authorizedPersonList>
|
||||
|
|
|
@ -97,29 +97,6 @@
|
|||
<dateBirth>1943-01-19T00:00:00+01:00</dateBirth>
|
||||
</birth>
|
||||
<dietcode>RSV</dietcode>
|
||||
<fsl>
|
||||
<dateDeb>2022-01-01T00:00:00+01:00</dateDeb>
|
||||
<dateFin>2022-12-31T00:00:00+01:00</dateFin>
|
||||
<allergieAlimentaire>O</allergieAlimentaire>
|
||||
<allergieRespiratoire>O</allergieRespiratoire>
|
||||
<allergieAutre>O</allergieAutre>
|
||||
<allergieMedicament>O</allergieMedicament>
|
||||
<asthme>N</asthme>
|
||||
<flPAI>N</flPAI>
|
||||
<flImage>N</flImage>
|
||||
<dtcPrap1>2022-02-22T00:00:00+01:00</dtcPrap1>
|
||||
<obsMed1>some obsMed1 text</obsMed1>
|
||||
<obsMed2>some obsMed2 text</obsMed2>
|
||||
<obsMed3>some obsMed3 text</obsMed3>
|
||||
<obsDir1>some obsDir1 text</obsDir1>
|
||||
<obsDir2>some obsDir2 text</obsDir2>
|
||||
<obsDir3>some obsDir3 text</obsDir3>
|
||||
<obsAssist1>some obsAssist1 text</obsAssist1>
|
||||
<obsAssist2>some obsAssist2 text</obsAssist2>
|
||||
<obsAssist3>some obsAssist3 text</obsAssist3>
|
||||
<cons1Med>some cons1Med text</cons1Med>
|
||||
<cons2Med>some cons2Med text</cons2Med>
|
||||
</fsl>
|
||||
<bPhoto>true</bPhoto>
|
||||
<bLeaveAlone>false</bLeaveAlone>
|
||||
<authorizedPersonList>
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
|
||||
<soap:Body>
|
||||
<ns2:createOrUpdateFSLResponse xmlns:ns2="family.ws.maelis.sigec.com"/>
|
||||
</soap:Body>
|
||||
</soap:Envelope>
|
|
@ -71,9 +71,7 @@ UPDATE_FAMILY_500 = FakedResponse(content=get_xml_file('R_update_family_soap_err
|
|||
UPDATE_DIETCODE = FakedResponse(content=get_xml_file('R_update_child_dietcode.xml'), status_code=200)
|
||||
UPDATE_PAI = FakedResponse(content=get_xml_file('R_update_child_pai.xml'), status_code=200)
|
||||
UPDATE_PAI_500 = FakedResponse(content=get_xml_file('R_update_child_pai_soap_error.xml'), status_code=500)
|
||||
UPDATE_FSL = FakedResponse(content=get_xml_file('R_update_child_fsl.xml'), status_code=200)
|
||||
UPDATE_FSL_500 = FakedResponse(content=get_xml_file('R_update_child_fsl_soap_error.xml'), status_code=500)
|
||||
UPDATE_MEDICAL = FakedResponse(content=get_xml_file('R_update_child_fsl.xml'), status_code=200)
|
||||
UPDATE_MEDICAL = FakedResponse(content=get_xml_file('R_update_child_medical_record.xml'), status_code=200)
|
||||
UPDATE_MEDICAL_500 = FakedResponse(
|
||||
content=get_xml_file('R_update_child_medical_record_soap_error.xml'), status_code=500
|
||||
)
|
||||
|
@ -614,7 +612,6 @@ def test_read_family(mocked_post, mocked_get, read_family, con, app):
|
|||
'subscribeActivityList': [],
|
||||
}
|
||||
data = resp.json['data']['childList'][0]
|
||||
del data['fsl']
|
||||
del data['medicalRecord']
|
||||
del data['authorizedPersonList']
|
||||
del data['paiInfoBean']
|
||||
|
@ -651,29 +648,6 @@ def test_read_family(mocked_post, mocked_get, read_family, con, app):
|
|||
'dateFin': '2022-12-31T00:00:00+01:00',
|
||||
'description': 'bla bla PAI',
|
||||
}
|
||||
assert resp.json['data']['childList'][0]['fsl'] == {
|
||||
'dateDeb': '2022-01-01T00:00:00+01:00',
|
||||
'dateFin': '2022-12-31T00:00:00+01:00',
|
||||
'allergieAlimentaire': True,
|
||||
'allergieRespiratoire': True,
|
||||
'allergieAutre': True,
|
||||
'allergieMedicament': True,
|
||||
'asthme': False,
|
||||
'flPAI': False,
|
||||
'flImage': False,
|
||||
'dtcPrap1': '2022-02-22T00:00:00+01:00',
|
||||
'obsMed1': 'some obsMed1 text',
|
||||
'obsMed2': 'some obsMed2 text',
|
||||
'obsMed3': 'some obsMed3 text',
|
||||
'obsDir1': 'some obsDir1 text',
|
||||
'obsDir2': 'some obsDir2 text',
|
||||
'obsDir3': 'some obsDir3 text',
|
||||
'obsAssist1': 'some obsAssist1 text',
|
||||
'obsAssist2': 'some obsAssist2 text',
|
||||
'obsAssist3': 'some obsAssist3 text',
|
||||
'cons1Med': 'some cons1Med text',
|
||||
'cons2Med': 'some cons2Med text',
|
||||
}
|
||||
assert resp.json['data']['childList'][0]['medicalRecord'] == {
|
||||
"familyDoctor": {
|
||||
"name": "DRE",
|
||||
|
@ -2656,75 +2630,6 @@ def test_update_child_pai_soap_error(mocked_post, mocked_get, con, app):
|
|||
assert 'maximum : 500' in resp.json['err_desc']
|
||||
|
||||
|
||||
@mock.patch('passerelle.utils.Request.get')
|
||||
@mock.patch('passerelle.utils.Request.post')
|
||||
def test_update_child_fsl(mocked_post, mocked_get, con, app):
|
||||
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
||||
mocked_post.return_value = UPDATE_FSL
|
||||
url = get_endpoint('update-child-fsl')
|
||||
params = {
|
||||
'dateDeb': '2022-01-01',
|
||||
'dateFin': '2022-12-31',
|
||||
'allergieAlimentaire': True,
|
||||
'allergieRespiratoire': True,
|
||||
'allergieAutre': True,
|
||||
'allergieMedicament': True,
|
||||
'asthme': False,
|
||||
'flPAI': False,
|
||||
'flImage': False,
|
||||
'dtcPrap1': '2022-02-22',
|
||||
'obsMed1': 'some obsMed1 text',
|
||||
'obsMed2': 'some obsMed2 text',
|
||||
'obsMed3': 'some obsMed3 text',
|
||||
'obsDir1': 'some obsDir1 text',
|
||||
'obsDir2': 'some obsDir2 text',
|
||||
'obsDir3': 'some obsDir3 text',
|
||||
'obsAssist1': 'some obsAssist1 text',
|
||||
'obsAssist2': 'some obsAssist2 text',
|
||||
'obsAssist3': 'some obsAssist3 text',
|
||||
'cons1Med': 'some cons1Med text',
|
||||
'cons2Med': 'some cons2Med text',
|
||||
}
|
||||
|
||||
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
||||
resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
|
||||
assert_sent_payload(mocked_post, 'Q_update_child_fsl.xml')
|
||||
assert resp.json['err'] == 0
|
||||
assert resp.json['data'] == 'ok'
|
||||
|
||||
|
||||
def test_update_child_fsl_not_linked_error(con, app):
|
||||
url = get_endpoint('update-child-fsl')
|
||||
params = {
|
||||
'dateDeb': '2022-01-01',
|
||||
'dateFin': '2022-12-31',
|
||||
}
|
||||
|
||||
resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
|
||||
assert resp.json['err'] == 'not-linked'
|
||||
assert resp.json['err_desc'] == 'User not linked to family'
|
||||
|
||||
|
||||
@mock.patch('passerelle.utils.Request.get')
|
||||
@mock.patch('passerelle.utils.Request.post')
|
||||
def test_update_child_fsl_soap_error(mocked_post, mocked_get, con, app):
|
||||
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
||||
mocked_post.return_value = UPDATE_FSL_500
|
||||
url = get_endpoint('update-child-fsl')
|
||||
params = {
|
||||
'dateDeb': '2022-01-01',
|
||||
'dateFin': '2022-12-31',
|
||||
'obsMed1': 'a' * 71,
|
||||
}
|
||||
|
||||
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
||||
resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
|
||||
assert resp.json['err'] == 'Family-createOrUpdateFSL-soap:Server'
|
||||
assert 'Une erreur est survenue' in resp.json['err_desc']
|
||||
assert 'valeur trop grande' in resp.json['err_desc']
|
||||
assert 'maximum : 70' in resp.json['err_desc']
|
||||
|
||||
|
||||
@mock.patch('passerelle.utils.Request.get')
|
||||
@mock.patch('passerelle.utils.Request.post')
|
||||
def test_update_child_medical_record(mocked_post, mocked_get, con, app):
|
||||
|
|
Loading…
Reference in New Issue