diff --git a/functests/toulouse_maelis/data/test_update_child_doctor.json b/functests/toulouse_maelis/data/test_update_child_doctor.json new file mode 100644 index 00000000..fa2d229f --- /dev/null +++ b/functests/toulouse_maelis/data/test_update_child_doctor.json @@ -0,0 +1,31 @@ +{ + "familyDoctor": { + "name": "HIBBERT", + "phone": "0656785678", + "address": { + "street1": "General Hospital", + "zipcode": "90701", + "town": "Springfield" + } + }, + "allergy1": null, + "allergy2": null, + "comment1": null, + "comment2": null, + "observ1": null, + "observ2": null, + "isAuthHospital": true, + "hospital": "Springfield General Hospital", + "vaccinList": [ + { + "code": "1", + "libelle": "TETANOS", + "vaccinationDate": "2022-02-22T00:00:00+01:00" + }, + { + "code": "8", + "libelle": "DTPOLIO", + "vaccinationDate": "2011-01-11T00:00:00+01:00" + } + ] +} diff --git a/functests/toulouse_maelis/test_02_family.py b/functests/toulouse_maelis/test_02_family.py index d0686aaa..fa2a502f 100644 --- a/functests/toulouse_maelis/test_02_family.py +++ b/functests/toulouse_maelis/test_02_family.py @@ -618,6 +618,24 @@ def test_update_child_medical_record(conn, update_data): update_data['bart_num'], ) + # update only doctor + # #2720: allergies comments, and observations are erased + payload = { + 'familyDoctor': { + 'name': 'Hibbert', + 'phone': '0656785678', + 'address': { + 'street1': 'General Hospital', + 'zipcode': '90701', + 'town': 'Springfield', + }, + }, + } + resp = requests.post(url, json=payload) + resp.raise_for_status() + assert resp.json()['err'] == 0 + assert diff_child(conn, update_data['name_id'], 0, 'test_update_child_doctor.json', key='medicalRecord') + # reset medical record payload = FAMILY_RESET_PAYLOAD['childList'][0]['medicalRecord'] resp = requests.post(url, json=payload)