1041 |
1041 |
'rl1/profession/codeCSP': 'ART',
|
1042 |
1042 |
'rl1/CAFInfo/organ': 'A10007752822',
|
1043 |
1043 |
'childList/0/lastname': 'Zimmerman',
|
1044 |
1044 |
'childList/0/firstname': 'Robert',
|
1045 |
1045 |
'childList/0/sexe': 'M',
|
1046 |
1046 |
'childList/0/dateBirth': '1941-05-24',
|
1047 |
1047 |
'childList/0/dietcode': 'RSV',
|
1048 |
1048 |
'childList/0/medicalRecord/vaccinList/0/code': 'DTC',
|
|
1049 |
'childList/0/medicalRecord/vaccinList/0/vaccinationDate': '1940-07-26',
|
1049 |
1050 |
}
|
1050 |
1051 |
|
1051 |
1052 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1052 |
1053 |
assert_sent_payload(mocked_post, 'Q_create_family.xml')
|
1053 |
1054 |
assert resp.json['err'] == 0
|
1054 |
1055 |
assert resp.json['data'] == {
|
1055 |
1056 |
'number': 196545,
|
1056 |
1057 |
'password': '394634V2',
|
... | ... | |
1161 |
1162 |
'rl1/profession/codeCSP': 'ART',
|
1162 |
1163 |
'rl1/CAFInfo/organ': 'A10007752822',
|
1163 |
1164 |
'childList/0/lastname': 'Zimmerman',
|
1164 |
1165 |
'childList/0/firstname': 'Robert',
|
1165 |
1166 |
'childList/0/sexe': 'M',
|
1166 |
1167 |
'childList/0/dateBirth': '1941-05-24',
|
1167 |
1168 |
'childList/0/dietcode': 'RSV',
|
1168 |
1169 |
'childList/0/medicalRecord/vaccinList/0/code': 'plop',
|
|
1170 |
'childList/0/medicalRecord/vaccinList/0/vaccinationDate': '1940-07-26',
|
1169 |
1171 |
}
|
1170 |
1172 |
|
1171 |
1173 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1172 |
1174 |
assert resp.json['err'] == 'wrong-key'
|
1173 |
1175 |
assert (
|
1174 |
1176 |
resp.json['err_desc']
|
1175 |
1177 |
== "childList/0/medicalRecord/vaccinList/0/code key value 'plop' do not belong to 'Vaccin' referential"
|
1176 |
1178 |
)
|
... | ... | |
1216 |
1218 |
'childList/0/lastname': 'Zimmerman',
|
1217 |
1219 |
'childList/0/firstname': 'Robert',
|
1218 |
1220 |
'childList/0/sexe': 'M',
|
1219 |
1221 |
'childList/0/birth/dateBirth': '1941-05-24',
|
1220 |
1222 |
'childList/0/birth/place': 'Duluth',
|
1221 |
1223 |
'childList/0/dietcode': 'RSV',
|
1222 |
1224 |
'childList/0/paiInfoBean/code': 'PAIALI',
|
1223 |
1225 |
'childList/0/medicalRecord/vaccinList/0/code': 'DTC',
|
|
1226 |
'childList/0/medicalRecord/vaccinList/0/vaccinationDate': '1940-07-26',
|
1224 |
1227 |
}
|
1225 |
1228 |
|
1226 |
1229 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1227 |
1230 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1228 |
1231 |
assert_sent_payload(mocked_post, 'Q_update_family.xml')
|
1229 |
1232 |
assert resp.json['err'] == 0
|
1230 |
1233 |
assert resp.json['data']['number'] == 196544
|
1231 |
1234 |
assert not resp.json['data']['childErrorList']
|
... | ... | |
1342 |
1345 |
'childList/0/lastname': 'Zimmerman',
|
1343 |
1346 |
'childList/0/firstname': 'Robert',
|
1344 |
1347 |
'childList/0/sexe': 'M',
|
1345 |
1348 |
'childList/0/birth/dateBirth': '1941-05-24',
|
1346 |
1349 |
'childList/0/birth/place': 'Duluth',
|
1347 |
1350 |
'childList/0/dietcode': 'RSV',
|
1348 |
1351 |
'childList/0/paiInfoBean/code': 'PAIALI',
|
1349 |
1352 |
'childList/0/medicalRecord/vaccinList/0/code': 'plop',
|
|
1353 |
'childList/0/medicalRecord/vaccinList/0/vaccinationDate': '1940-07-26',
|
1350 |
1354 |
}
|
1351 |
1355 |
|
1352 |
1356 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1353 |
1357 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1354 |
1358 |
assert resp.json['err'] == 'wrong-key'
|
1355 |
1359 |
assert (
|
1356 |
1360 |
resp.json['err_desc']
|
1357 |
1361 |
== "childList/0/medicalRecord/vaccinList/0/code key value 'plop' do not belong to 'Vaccin' referential"
|
... | ... | |
2661 |
2665 |
assert resp.json['err'] == 'not-linked'
|
2662 |
2666 |
assert resp.json['err_desc'] == 'User not linked to family'
|
2663 |
2667 |
|
2664 |
2668 |
|
2665 |
2669 |
@mock.patch('passerelle.utils.Request.get')
|
2666 |
2670 |
@mock.patch('passerelle.utils.Request.post')
|
2667 |
2671 |
def test_update_child_medical_record_soap_error(mocked_post, mocked_get, con, app):
|
2668 |
2672 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2669 |
|
mocked_post.side_effect = [UPDATE_MEDICAL_500]
|
|
2673 |
mocked_post.side_effect = [READ_VACCIN, UPDATE_MEDICAL_500]
|
2670 |
2674 |
url = get_endpoint('update-child-medical-record')
|
2671 |
2675 |
params = {
|
|
2676 |
'vaccinList/0/code': 'DTC',
|
2672 |
2677 |
'vaccinList/0/vaccinationDate': '2022-02-31',
|
2673 |
2678 |
}
|
2674 |
2679 |
|
2675 |
2680 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2676 |
2681 |
resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
|
2677 |
2682 |
assert resp.json['err'] == 'Family-updateChildMedicalRecord-soap:Client'
|
2678 |
2683 |
assert 'Unmarshalling Error' in resp.json['err_desc']
|
2679 |
2684 |
assert 'pas une valeur de calendrier grégorien' in resp.json['err_desc']
|
2680 |
|
-
|