toulouse-maelis: re-add update_family deleted test (#70851)

This commit is contained in:
Nicolas Roche 2022-10-23 13:35:34 +02:00
parent a36261a786
commit c2631bf672
1 changed files with 49 additions and 0 deletions

View File

@ -1203,6 +1203,55 @@ def test_create_family_wrong_referential_key_error(mocked_post, mocked_get, con,
)
@mock.patch('passerelle.utils.Request.get')
@mock.patch('passerelle.utils.Request.post')
def test_update_family(mocked_post, mocked_get, con, app):
mocked_get.return_value = FAMILY_SERVICE_WSDL
mocked_post.side_effect = [
READ_CATEGORIES,
READ_SITUATIONS,
READ_CIVILITIES,
READ_QUALITIES,
READ_CSP,
READ_ORGAN,
READ_DIETCODE,
READ_PAI,
READ_VACCIN,
UPDATE_FAMILY,
]
url = get_endpoint('update-family')
params = {
'categorie': 'BI',
'situation': 'C',
'rl1/civility': 'M.',
'rl1/firstname': 'Jhon',
'rl1/lastname': 'Doe',
'rl1/quality': 'AU',
'rl1/dateBirth': '1938-07-26',
'rl1/adresse/street1': 'Chateau',
'rl1/adresse/town': 'Paris',
'rl1/adresse/zipcode': '75014',
'rl1/adresse/numComp': 'B',
'rl1/profession/codeCSP': 'ART',
'rl1/CAFInfo/organ': 'A10007752822',
'childList/0/lastname': 'Zimmerman',
'childList/0/firstname': 'Robert',
'childList/0/sexe': 'M',
'childList/0/birth/dateBirth': '1941-05-24',
'childList/0/birth/place': 'Duluth',
'childList/0/dietcode': 'RSV',
'childList/0/paiInfoBean/code': 'PAIALI',
'childList/0/medicalRecord/vaccinList/0/code': 'DTC',
}
Link.objects.create(resource=con, family_id='1312', name_id='local')
resp = app.post_json(url + '?NameID=local', params=params)
assert_sent_payload(mocked_post, 'Q_update_family.xml')
assert resp.json['err'] == 0
assert resp.json['data']['number'] == 196544
assert not resp.json['data']['childErrorList']
def test_update_family_not_linked_error(con, app):
url = get_endpoint('update-family')
params = {