2748 |
2748 |
|
2749 |
2749 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2750 |
2750 |
resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
|
2751 |
2751 |
assert_sent_payload(mocked_post, 'Q_update_child_medical_record.xml')
|
2752 |
2752 |
assert resp.json['err'] == 0
|
2753 |
2753 |
assert resp.json['data'] == 'ok'
|
2754 |
2754 |
|
2755 |
2755 |
|
|
2756 |
@mock.patch('passerelle.utils.Request.get')
|
|
2757 |
@mock.patch('passerelle.utils.Request.post')
|
|
2758 |
def test_update_child_medical_record_with_empty_vaccin_list(mocked_post, mocked_get, con, app):
|
|
2759 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
|
2760 |
mocked_post.side_effect = [READ_VACCIN, UPDATE_MEDICAL]
|
|
2761 |
url = get_endpoint('update-child-medical-record')
|
|
2762 |
params = {
|
|
2763 |
'familyDoctor/name': 'Dre',
|
|
2764 |
'familyDoctor/phone': '0612341234',
|
|
2765 |
'familyDoctor/address/street1': 'Alameda',
|
|
2766 |
'familyDoctor/address/zipcode': '90220',
|
|
2767 |
'familyDoctor/address/town': 'Compton',
|
|
2768 |
'allergy1': 'butterscotch, imitation butterscotch, glow-in-the-dark monster make-up, and shrimp',
|
|
2769 |
'allergy2': 'cauliflower',
|
|
2770 |
'comment1': "the shrimp allergy isn't fully identified",
|
|
2771 |
'comment2': None,
|
|
2772 |
'observ1': 'Ay Caramba!',
|
|
2773 |
'observ2': None,
|
|
2774 |
'isAuthHospital': True,
|
|
2775 |
'hospital': 'Springfield General Hospital',
|
|
2776 |
}
|
|
2777 |
|
|
2778 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
|
2779 |
resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
|
|
2780 |
assert resp.json['err'] == 0
|
|
2781 |
assert resp.json['data'] == 'ok'
|
|
2782 |
|
|
2783 |
|
2756 |
2784 |
def test_update_child_medical_record_not_linked_error(con, app):
|
2757 |
2785 |
url = get_endpoint('update-child-medical-record')
|
2758 |
2786 |
|
2759 |
2787 |
resp = app.post_json(url + '?NameID=local&child_id=613878', params={})
|
2760 |
2788 |
assert resp.json['err'] == 'not-linked'
|
2761 |
2789 |
assert resp.json['err_desc'] == 'User not linked to family'
|
2762 |
2790 |
|
2763 |
2791 |
|
2764 |
|
-
|