75 |
75 |
|
76 |
76 |
|
77 |
77 |
def get_endpoint(name):
|
78 |
78 |
url = generic_endpoint_url('toulouse-maelis', name)
|
79 |
79 |
assert url == '/toulouse-maelis/test/%s' % name
|
80 |
80 |
return url
|
81 |
81 |
|
82 |
82 |
|
83 |
|
@pytest.fixture
|
84 |
|
def con(db):
|
85 |
|
return setup_access_rights(
|
86 |
|
ToulouseMaelis.objects.create(
|
87 |
|
slug='test',
|
88 |
|
zeep_wsse_username='maelis-webservice',
|
89 |
|
zeep_wsse_password='maelis-password',
|
|
83 |
@pytest.fixture(scope='module')
|
|
84 |
def django_db_setup(django_db_setup, django_db_blocker):
|
|
85 |
with django_db_blocker.unblock():
|
|
86 |
con = setup_access_rights(
|
|
87 |
ToulouseMaelis.objects.get_or_create(
|
|
88 |
slug='test',
|
|
89 |
zeep_wsse_username='maelis-webservice',
|
|
90 |
zeep_wsse_password='maelis-password',
|
|
91 |
)[0]
|
90 |
92 |
)
|
91 |
|
)
|
92 |
|
|
93 |
|
|
94 |
|
@pytest.fixture
|
95 |
|
def ref(con, caplog):
|
96 |
|
mocked_get = mock.patch('passerelle.utils.Request.get', return_value=FAMILY_SERVICE_WSDL)
|
97 |
|
mocked_post = mock.patch(
|
98 |
|
'passerelle.utils.Request.post',
|
99 |
|
side_effect=[
|
100 |
|
FakedResponse(content=get_xml_file('R_read_category_list.xml'), status_code=200),
|
101 |
|
FakedResponse(content=get_xml_file('R_read_child_indicator_list.xml'), status_code=200),
|
102 |
|
FakedResponse(content=get_xml_file('R_read_civility_list.xml'), status_code=200),
|
103 |
|
FakedResponse(content=get_xml_file('R_read_country_list.xml'), status_code=200),
|
104 |
|
FakedResponse(content=get_xml_file('R_read_csp_list.xml'), status_code=200),
|
105 |
|
FakedResponse(content=get_xml_file('R_read_dietcode_list.xml'), status_code=200),
|
106 |
|
FakedResponse(content=get_xml_file('R_read_organ_list.xml'), status_code=200),
|
107 |
|
FakedResponse(content=get_xml_file('R_read_pai_list.xml'), status_code=200),
|
108 |
|
FakedResponse(content=get_xml_file('R_read_quality_list.xml'), status_code=200),
|
109 |
|
FakedResponse(content=get_xml_file('R_read_quotient_list.xml'), status_code=200),
|
110 |
|
FakedResponse(content=get_xml_file('R_read_rl_indicator_list.xml'), status_code=200),
|
111 |
|
FakedResponse(content=get_xml_file('R_read_situation_list.xml'), status_code=200),
|
112 |
|
FakedResponse(content=get_xml_file('R_read_street_list.xml'), status_code=200),
|
113 |
|
FakedResponse(content=get_xml_file('R_read_vaccin_list.xml'), status_code=200),
|
114 |
|
],
|
115 |
|
)
|
116 |
|
mocked_get.start()
|
117 |
|
mocked_post.start()
|
118 |
|
con.daily()
|
119 |
|
assert caplog.messages[-1] == 'Réferentiels mis à jour.'
|
|
93 |
with mock.patch('passerelle.utils.Request.get') as mocked_get:
|
|
94 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
|
95 |
with mock.patch('passerelle.utils.Request.post') as mocked_post:
|
|
96 |
mocked_post.side_effect = [
|
|
97 |
FakedResponse(content=get_xml_file('R_read_category_list.xml'), status_code=200),
|
|
98 |
FakedResponse(content=get_xml_file('R_read_child_indicator_list.xml'), status_code=200),
|
|
99 |
FakedResponse(content=get_xml_file('R_read_civility_list.xml'), status_code=200),
|
|
100 |
FakedResponse(content=get_xml_file('R_read_country_list.xml'), status_code=200),
|
|
101 |
FakedResponse(content=get_xml_file('R_read_csp_list.xml'), status_code=200),
|
|
102 |
FakedResponse(content=get_xml_file('R_read_dietcode_list.xml'), status_code=200),
|
|
103 |
FakedResponse(content=get_xml_file('R_read_organ_list.xml'), status_code=200),
|
|
104 |
FakedResponse(content=get_xml_file('R_read_pai_list.xml'), status_code=200),
|
|
105 |
FakedResponse(content=get_xml_file('R_read_quality_list.xml'), status_code=200),
|
|
106 |
FakedResponse(content=get_xml_file('R_read_quotient_list.xml'), status_code=200),
|
|
107 |
FakedResponse(content=get_xml_file('R_read_rl_indicator_list.xml'), status_code=200),
|
|
108 |
FakedResponse(content=get_xml_file('R_read_situation_list.xml'), status_code=200),
|
|
109 |
FakedResponse(content=get_xml_file('R_read_street_list.xml'), status_code=200),
|
|
110 |
FakedResponse(content=get_xml_file('R_read_vaccin_list.xml'), status_code=200),
|
|
111 |
]
|
|
112 |
con.daily()
|
|
113 |
|
|
114 |
# reset change in zeep private interface to bypass clear_cache fixture
|
|
115 |
from zeep.cache import InMemoryCache
|
|
116 |
|
|
117 |
InMemoryCache._cache = {}
|
|
118 |
|
|
119 |
|
|
120 |
@pytest.fixture()
|
|
121 |
def con(db):
|
|
122 |
return ToulouseMaelis.objects.get()
|
120 |
123 |
|
121 |
124 |
|
122 |
125 |
@mock.patch('passerelle.utils.Request.get')
|
123 |
126 |
def test_call_with_wrong_wsdl_url(mocked_get, con):
|
124 |
127 |
mocked_get.side_effect = CONNECTION_ERROR
|
125 |
128 |
with pytest.raises(
|
126 |
129 |
SOAPError,
|
127 |
130 |
match='cannot be loaded: No address associated with hostname',
|
... | ... | |
238 |
241 |
content=get_xml_file('R_read_category_list_2_items.xml'), status_code=200
|
239 |
242 |
)
|
240 |
243 |
con.update_referential('Category')
|
241 |
244 |
assert [
|
242 |
245 |
(x.item_id, x.item_text) for x in Referential.objects.filter(referential_name='Category')
|
243 |
246 |
] == [('BI', 'BIPARENTALE'), ('ACCEUI', 'Famille acceuillante')]
|
244 |
247 |
|
245 |
248 |
|
246 |
|
def test_cron(ref):
|
|
249 |
def test_cron(db):
|
247 |
250 |
assert Referential.objects.filter(referential_name='Category').count() == 3
|
248 |
251 |
assert sorted(list({x.referential_name for x in Referential.objects.all()})) == [
|
249 |
252 |
'CSP',
|
250 |
253 |
'Category',
|
251 |
254 |
'ChildIndicator',
|
252 |
255 |
'Civility',
|
253 |
256 |
'Complement',
|
254 |
257 |
'Country',
|
... | ... | |
316 |
319 |
assert resp.json['err'] == 0
|
317 |
320 |
assert resp.json['data'] == 'ok'
|
318 |
321 |
|
319 |
322 |
resp = app.post_json(url + '?NameID=local')
|
320 |
323 |
assert resp.json['err'] == 'not-linked'
|
321 |
324 |
assert resp.json['err_desc'] == 'User not linked to family'
|
322 |
325 |
|
323 |
326 |
|
324 |
|
def test_get_referential(con, ref):
|
|
327 |
def test_get_referential(con):
|
325 |
328 |
assert con.get_referential('Category') == [
|
326 |
329 |
{'code': 'BI', 'id': 'BI', 'libelle': 'BIPARENTALE', 'text': 'BIPARENTALE'},
|
327 |
330 |
{'code': 'ACCEUI', 'id': 'ACCEUI', 'libelle': "FAMILLE D'ACCUEIL", 'text': "FAMILLE D'ACCUEIL"},
|
328 |
331 |
{'code': 'MONO', 'id': 'MONO', 'libelle': 'MONOPARENTALE', 'text': 'MONOPARENTALE'},
|
329 |
332 |
]
|
330 |
333 |
|
331 |
334 |
|
332 |
|
def test_get_referential_value(con, ref):
|
|
335 |
def test_get_referential_value(con):
|
333 |
336 |
assert con.get_referential_value('CSP', '1') == 'AGRICULTEUR'
|
334 |
337 |
assert con.get_referential_value('CSP', 'AGR') == 'AGRICULTEUR'
|
335 |
338 |
|
336 |
339 |
|
337 |
|
def test_get_referential_value_not_found(con, ref, caplog):
|
|
340 |
def test_get_referential_value_not_found(con, caplog):
|
338 |
341 |
assert con.get_referential_value('Civility', 'MR') == 'MR'
|
339 |
342 |
assert len(caplog.records) == 1
|
340 |
343 |
assert caplog.records[0].levelno == logging.WARNING
|
341 |
344 |
assert caplog.records[0].message == "No 'MR' key into Maelis 'Civility' referential"
|
342 |
345 |
|
343 |
346 |
|
344 |
|
def test_read_category_list(con, ref, app):
|
|
347 |
def test_read_category_list(con, app):
|
345 |
348 |
url = get_endpoint('read-category-list')
|
346 |
349 |
|
347 |
350 |
resp = app.get(url)
|
348 |
351 |
assert resp.json['err'] == 0
|
349 |
352 |
assert resp.json['data'] == [
|
350 |
353 |
{'id': 'BI', 'text': 'BIPARENTALE', 'code': 'BI', 'libelle': 'BIPARENTALE'},
|
351 |
354 |
{'id': 'ACCEUI', 'text': "FAMILLE D'ACCUEIL", 'code': 'ACCEUI', 'libelle': "FAMILLE D'ACCUEIL"},
|
352 |
355 |
{'id': 'MONO', 'text': 'MONOPARENTALE', 'code': 'MONO', 'libelle': 'MONOPARENTALE'},
|
353 |
356 |
]
|
354 |
357 |
|
355 |
358 |
|
356 |
|
def test_read_country_list(con, ref, app):
|
|
359 |
def test_read_country_list(con, app):
|
357 |
360 |
url = get_endpoint('read-country-list')
|
358 |
361 |
|
359 |
362 |
resp = app.get(url)
|
360 |
363 |
assert resp.json['err'] == 0
|
361 |
364 |
assert len(resp.json['data']) == 3
|
362 |
365 |
assert resp.json['data'] == [
|
363 |
366 |
{'id': '212', 'code': '212', 'text': 'AFGHANISTAN', 'libelle': 'AFGHANISTAN'},
|
364 |
367 |
{'id': '303', 'code': '303', 'text': 'AFRIQUE DU SUD', 'libelle': 'AFRIQUE DU SUD'},
|
365 |
368 |
{'id': '125', 'code': '125', 'text': 'ALBANIE', 'libelle': 'ALBANIE'},
|
366 |
369 |
]
|
367 |
370 |
|
368 |
371 |
|
369 |
|
def test_read_child_indicator_list(con, ref, app):
|
|
372 |
def test_read_child_indicator_list(con, app):
|
370 |
373 |
url = get_endpoint('read-child-indicator-list')
|
371 |
374 |
resp = app.get(url)
|
372 |
375 |
assert resp.json['err'] == 0
|
373 |
376 |
assert len(resp.json['data']) == 8
|
374 |
377 |
assert resp.json['data'][0:2] == [
|
375 |
378 |
{
|
376 |
379 |
'id': 'AUTRE',
|
377 |
380 |
'text': 'Autre',
|
... | ... | |
386 |
389 |
'choiceList': [],
|
387 |
390 |
'code': 'AVL',
|
388 |
391 |
'label': 'Auxiliaire de Vie loisirs',
|
389 |
392 |
'typeDesc': 'NONE',
|
390 |
393 |
},
|
391 |
394 |
]
|
392 |
395 |
|
393 |
396 |
|
394 |
|
def test_read_civility_list(con, ref, app):
|
|
397 |
def test_read_civility_list(con, app):
|
395 |
398 |
url = get_endpoint('read-civility-list')
|
396 |
399 |
resp = app.get(url)
|
397 |
400 |
assert resp.json['err'] == 0
|
398 |
401 |
assert resp.json['data'] == [
|
399 |
402 |
{'id': 'MME', 'code': 'MME', 'text': 'Madame', 'libelle': 'Madame'},
|
400 |
403 |
{'id': 'M.', 'code': 'M.', 'text': 'Monsieur', 'libelle': 'Monsieur'},
|
401 |
404 |
]
|
402 |
405 |
|
403 |
406 |
|
404 |
|
def test_read_complement_list(con, ref, app):
|
|
407 |
def test_read_complement_list(con, app):
|
405 |
408 |
url = get_endpoint('read-complement-list')
|
406 |
409 |
resp = app.get(url)
|
407 |
410 |
assert resp.json['err'] == 0
|
408 |
411 |
assert resp.json['data'] == [
|
409 |
412 |
{'id': 'B', 'text': 'bis'},
|
410 |
413 |
{'id': 'Q', 'text': 'quater'},
|
411 |
414 |
{'id': 'T', 'text': 'ter'},
|
412 |
415 |
]
|
413 |
416 |
|
414 |
417 |
|
415 |
|
def test_read_csp_list(con, ref, app):
|
|
418 |
def test_read_csp_list(con, app):
|
416 |
419 |
url = get_endpoint('read-csp-list')
|
417 |
420 |
resp = app.get(url)
|
418 |
421 |
assert resp.json['err'] == 0
|
419 |
422 |
assert resp.json['data'][:5] == [
|
420 |
423 |
{'code': '14', 'id': '14', 'libelle': 'AGENT DE MAITRISE', 'text': 'AGENT DE MAITRISE'},
|
421 |
424 |
{'code': '1', 'id': '1', 'libelle': 'AGRICULTEUR', 'text': 'AGRICULTEUR'},
|
422 |
425 |
{'code': 'ART', 'id': 'ART', 'libelle': 'ARTISAN', 'text': 'ARTISAN'},
|
423 |
426 |
{'code': '2', 'id': '2', 'libelle': 'ARTISAN-COMMERCANT', 'text': 'ARTISAN-COMMERCANT'},
|
424 |
427 |
{'code': '15', 'id': '15', 'libelle': 'AUTRES', 'text': 'AUTRES'},
|
425 |
428 |
]
|
426 |
429 |
|
427 |
430 |
|
428 |
|
def test_read_dietcode_list(con, ref, app):
|
|
431 |
def test_read_dietcode_list(con, app):
|
429 |
432 |
url = get_endpoint('read-dietcode-list')
|
430 |
433 |
resp = app.get(url)
|
431 |
434 |
assert resp.json['err'] == 0
|
432 |
435 |
assert resp.json['data'] == [
|
433 |
436 |
{'id': 'STD', 'code': 'STD', 'text': '1- REPAS STANDARD', 'libelle': '1- REPAS STANDARD'},
|
434 |
437 |
{'id': 'RSP', 'code': 'RSP', 'text': '2- RÉGIME SANS PORC', 'libelle': '2- RÉGIME SANS PORC'},
|
435 |
438 |
{'id': 'RSV', 'code': 'RSV', 'text': '3- RÉGIME SANS VIANDE', 'libelle': '3- RÉGIME SANS VIANDE'},
|
436 |
439 |
{
|
... | ... | |
441 |
444 |
},
|
442 |
445 |
{'id': 'BB', 'code': 'BB', 'text': 'REPAS BEBE', 'libelle': 'REPAS BEBE'},
|
443 |
446 |
{'id': 'MSP', 'code': 'MSP', 'text': 'REPAS MOYEN SANS PORC', 'libelle': 'REPAS MOYEN SANS PORC'},
|
444 |
447 |
{'id': 'MSV', 'code': 'MSV', 'text': 'REPAS MOYEN SANS VIANDE', 'libelle': 'REPAS MOYEN SANS VIANDE'},
|
445 |
448 |
{'id': 'MST', 'code': 'MST', 'text': 'REPAS MOYEN STANDARD', 'libelle': 'REPAS MOYEN STANDARD'},
|
446 |
449 |
]
|
447 |
450 |
|
448 |
451 |
|
449 |
|
def test_read_organ_list(con, ref, app):
|
|
452 |
def test_read_organ_list(con, app):
|
450 |
453 |
url = get_endpoint('read-organ-list')
|
451 |
454 |
resp = app.get(url)
|
452 |
455 |
assert resp.json['err'] == 0
|
453 |
456 |
assert len(resp.json['data']) == 92
|
454 |
457 |
assert resp.json['data'][:5] == [
|
455 |
458 |
{'id': 'A10000979374', 'code': 'ALC L OLIVIER', 'text': 'ALC L OLIVIER', 'libelle': None},
|
456 |
459 |
{'id': 'A10000979372', 'code': 'ALVA 06', 'text': 'ALVA 06', 'libelle': None},
|
457 |
460 |
{'id': 'A10000980566', 'code': 'ANTIBES', 'text': 'ANTIBES', 'libelle': None},
|
458 |
461 |
{'id': 'A10000980388', 'code': 'APAJH', 'text': 'APAJH', 'libelle': None},
|
459 |
462 |
{'id': 'A10016401771', 'code': 'ASCROS', 'text': 'ASCROS', 'libelle': None},
|
460 |
463 |
]
|
461 |
464 |
|
462 |
465 |
|
463 |
|
def test_read_pai_list(con, ref, app):
|
|
466 |
def test_read_pai_list(con, app):
|
464 |
467 |
url = get_endpoint('read-pai-list')
|
465 |
468 |
resp = app.get(url)
|
466 |
469 |
assert resp.json['err'] == 0
|
467 |
470 |
assert resp.json['data'] == [
|
468 |
471 |
{'id': 'PAIALI', 'code': 'PAIALI', 'text': 'ALIMENTAIRE', 'libelle': 'ALIMENTAIRE'},
|
469 |
472 |
{'id': 'PAIO', 'code': 'PAIO', 'text': 'AUTRE', 'libelle': 'AUTRE'},
|
470 |
473 |
{'id': 'PAIMED', 'code': 'PAIMED', 'text': 'MEDICAL', 'libelle': 'MEDICAL'},
|
471 |
474 |
{'id': 'PAI2', 'code': 'PAI2', 'text': 'MEDICAL ET ALIMENTAIRE', 'libelle': 'MEDICAL ET ALIMENTAIRE'},
|
472 |
475 |
]
|
473 |
476 |
|
474 |
477 |
|
475 |
|
def test_read_quality_list(con, ref, app):
|
|
478 |
def test_read_quality_list(con, app):
|
476 |
479 |
url = get_endpoint('read-quality-list')
|
477 |
480 |
resp = app.get(url)
|
478 |
481 |
assert resp.json['err'] == 0
|
479 |
482 |
assert resp.json['data'][:5] == [
|
480 |
483 |
{'id': 'AU', 'code': 'AU', 'text': 'AUTRE', 'libelle': 'AUTRE'},
|
481 |
484 |
{'id': 'BP', 'code': 'BP', 'text': 'BEAU PERE', 'libelle': 'BEAU PERE'},
|
482 |
485 |
{'id': 'BM', 'code': 'BM', 'text': 'BELLE MERE', 'libelle': 'BELLE MERE'},
|
483 |
486 |
{'id': 'CONSO', 'code': 'CONSO', 'text': 'CONSOMMATEUR', 'libelle': 'CONSOMMATEUR'},
|
484 |
487 |
{'id': 'EN', 'code': 'EN', 'text': 'ENFANT', 'libelle': 'ENFANT'},
|
485 |
488 |
]
|
486 |
489 |
|
487 |
490 |
|
488 |
|
def test_read_quotient_list(con, ref, app):
|
|
491 |
def test_read_quotient_list(con, app):
|
489 |
492 |
url = get_endpoint('read-quotient-list')
|
490 |
493 |
resp = app.get(url)
|
491 |
494 |
assert resp.json['err'] == 0
|
492 |
495 |
assert resp.json['data'] == [
|
493 |
496 |
{'id': 'QF', 'code': 'QF', 'text': 'GRILLE DE QUOTIENT', 'libelle': 'GRILLE DE QUOTIENT'},
|
494 |
497 |
{'id': 'QCLSH', 'code': 'QCLSH', 'text': 'QUOTIENT CENTRE AERE', 'libelle': 'QUOTIENT CENTRE AERE'},
|
495 |
498 |
{'id': 'QJEU', 'code': 'QJEU', 'text': 'QUOTIENT JEUNESSE', 'libelle': 'QUOTIENT JEUNESSE'},
|
496 |
499 |
{'id': 'QS', 'code': 'QS', 'text': 'QUOTIENT SCOLAIRE', 'libelle': 'QUOTIENT SCOLAIRE'},
|
... | ... | |
499 |
502 |
'id': 'MOY ECO',
|
500 |
503 |
'code': 'MOY ECO',
|
501 |
504 |
'text': 'REVENU MOYEN ( MENSUEL OU ANNUEL)',
|
502 |
505 |
'libelle': 'REVENU MOYEN ( MENSUEL OU ANNUEL)',
|
503 |
506 |
},
|
504 |
507 |
]
|
505 |
508 |
|
506 |
509 |
|
507 |
|
def test_read_rl_indicator_list(con, ref, app):
|
|
510 |
def test_read_rl_indicator_list(con, app):
|
508 |
511 |
url = get_endpoint('read-rl-indicator-list')
|
509 |
512 |
resp = app.get(url)
|
510 |
513 |
assert resp.json['err'] == 0
|
511 |
514 |
assert len(resp.json['data']) == 4
|
512 |
515 |
assert resp.json['data'][1:3] == [
|
513 |
516 |
{
|
514 |
517 |
'id': 'AVS',
|
515 |
518 |
'text': 'Auxiliaire de Vie scolaire',
|
... | ... | |
524 |
527 |
'choiceList': [],
|
525 |
528 |
'code': 'ETABSPEC',
|
526 |
529 |
'label': 'Etablissement spécialisé',
|
527 |
530 |
'typeDesc': 'NOTE',
|
528 |
531 |
},
|
529 |
532 |
]
|
530 |
533 |
|
531 |
534 |
|
532 |
|
def test_read_sex_list(con, app, ref):
|
|
535 |
def test_read_sex_list(con, app):
|
533 |
536 |
url = get_endpoint('read-sex-list')
|
534 |
537 |
|
535 |
538 |
resp = app.get(url)
|
536 |
539 |
assert resp.json['err'] == 0
|
537 |
540 |
assert resp.json['data'] == [
|
538 |
541 |
{'id': 'F', 'text': 'Féminin'},
|
539 |
542 |
{'id': 'M', 'text': 'Masculin'},
|
540 |
543 |
]
|
541 |
544 |
|
542 |
545 |
|
543 |
|
def test_read_situation_list(con, ref, app):
|
|
546 |
def test_read_situation_list(con, app):
|
544 |
547 |
url = get_endpoint('read-situation-list')
|
545 |
548 |
resp = app.get(url)
|
546 |
549 |
assert resp.json['err'] == 0
|
547 |
550 |
assert resp.json['data'][:5] == [
|
548 |
551 |
{'id': 'C', 'code': 'C', 'text': 'Célibataire', 'libelle': 'Célibataire'},
|
549 |
552 |
{'id': 'D', 'code': 'D', 'text': 'Divorcé (e)', 'libelle': 'Divorcé (e)'},
|
550 |
553 |
{'id': 'CS', 'code': 'CS', 'text': 'EN COURS DE SEPARATION', 'libelle': 'EN COURS DE SEPARATION'},
|
551 |
554 |
{'id': 'M', 'code': 'M', 'text': 'Marié (e)', 'libelle': 'Marié (e)'},
|
552 |
555 |
{'id': 'P', 'code': 'P', 'text': 'Pacsé (e)', 'libelle': 'Pacsé (e)'},
|
553 |
556 |
]
|
554 |
557 |
|
555 |
558 |
|
556 |
|
def test_read_street_list(con, ref, app):
|
|
559 |
def test_read_street_list(con, app):
|
557 |
560 |
url = get_endpoint('read-street-list')
|
558 |
561 |
resp = app.get(url)
|
559 |
562 |
assert resp.json['err'] == 0
|
560 |
563 |
assert len(resp.json['data']) == 3
|
561 |
564 |
assert resp.json['data'] == [
|
562 |
565 |
{'id': 'AP0594', 'text': 'AVENUE PAULIANI', 'idStreet': 'AP0594', 'libelleStreet': 'AVENUE PAULIANI'},
|
563 |
566 |
{
|
564 |
567 |
'id': 'AS0264',
|
... | ... | |
570 |
573 |
'id': 'AM0330',
|
571 |
574 |
'text': 'TRAVERSE DES MARAICHERS',
|
572 |
575 |
'idStreet': 'AM0330',
|
573 |
576 |
'libelleStreet': 'TRAVERSE DES MARAICHERS',
|
574 |
577 |
},
|
575 |
578 |
]
|
576 |
579 |
|
577 |
580 |
|
578 |
|
def test_read_vaccin_list(con, ref, app):
|
|
581 |
def test_read_vaccin_list(con, app):
|
579 |
582 |
url = get_endpoint('read-vaccin-list')
|
580 |
583 |
resp = app.get(url)
|
581 |
584 |
assert resp.json['err'] == 0
|
582 |
585 |
assert len(resp.json['data']) == 20
|
583 |
586 |
assert resp.json['data'][:5] == [
|
584 |
587 |
{'id': 'BCG', 'code': 'BCG', 'text': 'BCG', 'libelle': 'BCG'},
|
585 |
588 |
{
|
586 |
589 |
'id': 'CIB',
|
... | ... | |
597 |
600 |
'libelle': 'DIPHTERIE TETANOS COQUELUCHE',
|
598 |
601 |
},
|
599 |
602 |
]
|
600 |
603 |
|
601 |
604 |
|
602 |
605 |
@pytest.mark.parametrize("read_family", [READ_FAMILY, READ_FAMILY_LAX, READ_FAMILY_ORD])
|
603 |
606 |
@mock.patch('passerelle.utils.Request.get')
|
604 |
607 |
@mock.patch('passerelle.utils.Request.post')
|
605 |
|
def test_read_family(mocked_post, mocked_get, read_family, con, ref, app):
|
|
608 |
def test_read_family(mocked_post, mocked_get, read_family, con, app):
|
606 |
609 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
607 |
610 |
mocked_post.return_value = read_family
|
608 |
611 |
url = get_endpoint('read-family')
|
609 |
612 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
610 |
613 |
|
611 |
614 |
resp = app.get(url + '?NameID=local')
|
612 |
615 |
assert resp.json['err'] == 0
|
613 |
616 |
data = resp.json['data']
|
... | ... | |
780 |
783 |
|
781 |
784 |
resp = app.get(url + '?NameID=')
|
782 |
785 |
assert resp.json['err'] == 'not-linked'
|
783 |
786 |
assert resp.json['err_desc'] == 'User not linked to family'
|
784 |
787 |
|
785 |
788 |
|
786 |
789 |
@mock.patch('passerelle.utils.Request.get')
|
787 |
790 |
@mock.patch('passerelle.utils.Request.post')
|
788 |
|
def test_read_rl1(mocked_post, mocked_get, con, ref, app):
|
|
791 |
def test_read_rl1(mocked_post, mocked_get, con, app):
|
789 |
792 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
790 |
793 |
mocked_post.return_value = READ_FAMILY
|
791 |
794 |
url = get_endpoint('read-rl')
|
792 |
795 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
793 |
796 |
|
794 |
797 |
resp = app.get(url + '?NameID=local&rl_id=613878')
|
795 |
798 |
assert resp.json['err'] == 0
|
796 |
799 |
assert resp.json['data']['firstname'] == 'JHON'
|
797 |
800 |
|
798 |
801 |
|
799 |
802 |
@mock.patch('passerelle.utils.Request.get')
|
800 |
803 |
@mock.patch('passerelle.utils.Request.post')
|
801 |
|
def test_read_rl2(mocked_post, mocked_get, con, ref, app):
|
|
804 |
def test_read_rl2(mocked_post, mocked_get, con, app):
|
802 |
805 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
803 |
806 |
mocked_post.return_value = READ_FAMILY
|
804 |
807 |
url = get_endpoint('read-rl')
|
805 |
808 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
806 |
809 |
|
807 |
810 |
resp = app.get(url + '?NameID=local&rl_id=613879')
|
808 |
811 |
assert resp.json['err'] == 0
|
809 |
812 |
assert resp.json['data'] == {
|
... | ... | |
862 |
865 |
|
863 |
866 |
resp = app.get(url + '?NameID=local&rl_id=613879')
|
864 |
867 |
assert resp.json['err'] == 'not-linked'
|
865 |
868 |
assert resp.json['err_desc'] == 'User not linked to family'
|
866 |
869 |
|
867 |
870 |
|
868 |
871 |
@mock.patch('passerelle.utils.Request.get')
|
869 |
872 |
@mock.patch('passerelle.utils.Request.post')
|
870 |
|
def test_read_rl_not_found(mocked_post, mocked_get, con, ref, app):
|
|
873 |
def test_read_rl_not_found(mocked_post, mocked_get, con, app):
|
871 |
874 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
872 |
875 |
mocked_post.return_value = READ_FAMILY
|
873 |
876 |
url = get_endpoint('read-rl')
|
874 |
877 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
875 |
878 |
|
876 |
879 |
resp = app.get(url + '?NameID=local&rl_id=000000')
|
877 |
880 |
assert resp.json['err'] == 'not-found'
|
878 |
881 |
assert resp.json['err_desc'] == "no '000000' RL on '1312' family"
|
879 |
882 |
|
880 |
883 |
|
881 |
884 |
@mock.patch('passerelle.utils.Request.get')
|
882 |
885 |
@mock.patch('passerelle.utils.Request.post')
|
883 |
|
def test_read_person(mocked_post, mocked_get, con, ref, app):
|
|
886 |
def test_read_person(mocked_post, mocked_get, con, app):
|
884 |
887 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
885 |
888 |
mocked_post.return_value = READ_FAMILY
|
886 |
889 |
url = get_endpoint('read-person')
|
887 |
890 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
888 |
891 |
|
889 |
892 |
resp = app.get(url + '?NameID=local&person_id=614059')
|
890 |
893 |
assert resp.json['err'] == 0
|
891 |
894 |
assert resp.json['data']['firstname'] == 'KENY'
|
... | ... | |
896 |
899 |
|
897 |
900 |
resp = app.get(url + '?NameID=local&person_id=614059')
|
898 |
901 |
assert resp.json['err'] == 'not-linked'
|
899 |
902 |
assert resp.json['err_desc'] == 'User not linked to family'
|
900 |
903 |
|
901 |
904 |
|
902 |
905 |
@mock.patch('passerelle.utils.Request.get')
|
903 |
906 |
@mock.patch('passerelle.utils.Request.post')
|
904 |
|
def test_read_person_not_found(mocked_post, mocked_get, con, ref, app):
|
|
907 |
def test_read_person_not_found(mocked_post, mocked_get, con, app):
|
905 |
908 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
906 |
909 |
mocked_post.return_value = READ_FAMILY
|
907 |
910 |
url = get_endpoint('read-person')
|
908 |
911 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
909 |
912 |
|
910 |
913 |
resp = app.get(url + '?NameID=local&person_id=000000')
|
911 |
914 |
assert resp.json['err'] == 'not-found'
|
912 |
915 |
assert resp.json['err_desc'] == "no '000000' emergency person on '1312' family"
|
913 |
916 |
|
914 |
917 |
|
915 |
918 |
@mock.patch('passerelle.utils.Request.get')
|
916 |
919 |
@mock.patch('passerelle.utils.Request.post')
|
917 |
|
def test_read_child(mocked_post, mocked_get, con, ref, app):
|
|
920 |
def test_read_child(mocked_post, mocked_get, con, app):
|
918 |
921 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
919 |
922 |
mocked_post.return_value = READ_FAMILY
|
920 |
923 |
url = get_endpoint('read-child')
|
921 |
924 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
922 |
925 |
|
923 |
926 |
resp = app.get(url + '?NameID=local&child_id=613880')
|
924 |
927 |
assert resp.json['err'] == 0
|
925 |
928 |
assert resp.json['data']['firstname'] == 'JANNIS'
|
... | ... | |
930 |
933 |
|
931 |
934 |
resp = app.get(url + '?NameID=local&child_id=613880')
|
932 |
935 |
assert resp.json['err'] == 'not-linked'
|
933 |
936 |
assert resp.json['err_desc'] == 'User not linked to family'
|
934 |
937 |
|
935 |
938 |
|
936 |
939 |
@mock.patch('passerelle.utils.Request.get')
|
937 |
940 |
@mock.patch('passerelle.utils.Request.post')
|
938 |
|
def test_read_child_not_found(mocked_post, mocked_get, con, ref, app):
|
|
941 |
def test_read_child_not_found(mocked_post, mocked_get, con, app):
|
939 |
942 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
940 |
943 |
mocked_post.return_value = READ_FAMILY
|
941 |
944 |
url = get_endpoint('read-child')
|
942 |
945 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
943 |
946 |
|
944 |
947 |
resp = app.get(url + '?NameID=local&child_id=000000')
|
945 |
948 |
assert resp.json['err'] == 'not-found'
|
946 |
949 |
assert resp.json['err_desc'] == "no '000000' child on '1312' family"
|
947 |
950 |
|
948 |
951 |
|
949 |
952 |
@mock.patch('passerelle.utils.Request.get')
|
950 |
953 |
@mock.patch('passerelle.utils.Request.post')
|
951 |
|
def test_read_child_person(mocked_post, mocked_get, con, ref, app):
|
|
954 |
def test_read_child_person(mocked_post, mocked_get, con, app):
|
952 |
955 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
953 |
956 |
mocked_post.return_value = READ_FAMILY
|
954 |
957 |
url = get_endpoint('read-child-person')
|
955 |
958 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
956 |
959 |
|
957 |
960 |
resp = app.get(url + '?NameID=local&child_id=613880&person_id=614719')
|
958 |
961 |
assert resp.json['err'] == 0
|
959 |
962 |
assert resp.json['data']['personInfo']['firstname'] == 'AMEL'
|
... | ... | |
964 |
967 |
|
965 |
968 |
resp = app.get(url + '?NameID=local&child_id=613880&person_id=614719')
|
966 |
969 |
assert resp.json['err'] == 'not-linked'
|
967 |
970 |
assert resp.json['err_desc'] == 'User not linked to family'
|
968 |
971 |
|
969 |
972 |
|
970 |
973 |
@mock.patch('passerelle.utils.Request.get')
|
971 |
974 |
@mock.patch('passerelle.utils.Request.post')
|
972 |
|
def test_read_child_person_no_child_error(mocked_post, mocked_get, con, ref, app):
|
|
975 |
def test_read_child_person_no_child_error(mocked_post, mocked_get, con, app):
|
973 |
976 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
974 |
977 |
mocked_post.return_value = READ_FAMILY
|
975 |
978 |
url = get_endpoint('read-child-person')
|
976 |
979 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
977 |
980 |
|
978 |
981 |
resp = app.get(url + '?NameID=local&child_id=42&person_id=614719')
|
979 |
982 |
assert resp.json['err'] == 'not-found'
|
980 |
983 |
assert resp.json['err_desc'] == "no '42' child on '1312' family"
|
981 |
984 |
|
982 |
985 |
|
983 |
986 |
@mock.patch('passerelle.utils.Request.get')
|
984 |
987 |
@mock.patch('passerelle.utils.Request.post')
|
985 |
|
def test_read_child_person_no_person_error(mocked_post, mocked_get, con, ref, app):
|
|
988 |
def test_read_child_person_no_person_error(mocked_post, mocked_get, con, app):
|
986 |
989 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
987 |
990 |
mocked_post.return_value = READ_FAMILY
|
988 |
991 |
url = get_endpoint('read-child-person')
|
989 |
992 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
990 |
993 |
|
991 |
994 |
resp = app.get(url + '?NameID=local&child_id=613880&person_id=000000')
|
992 |
995 |
assert resp.json['err'] == 'not-found'
|
993 |
996 |
assert resp.json['err_desc'] == "no '000000' authorized person on '613880' child"
|
... | ... | |
1051 |
1054 |
}
|
1052 |
1055 |
resp = app.post_json(url, params=params)
|
1053 |
1056 |
assert resp.json['err'] == 0
|
1054 |
1057 |
assert resp.json['data'] == result
|
1055 |
1058 |
|
1056 |
1059 |
|
1057 |
1060 |
@mock.patch('passerelle.utils.Request.get')
|
1058 |
1061 |
@mock.patch('passerelle.utils.Request.post')
|
1059 |
|
def test_create_family(mocked_post, mocked_get, con, ref, app):
|
|
1062 |
def test_create_family(mocked_post, mocked_get, con, app):
|
1060 |
1063 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1061 |
1064 |
mocked_post.return_value = CREATE_FAMILY
|
1062 |
1065 |
url = get_endpoint('create-family')
|
1063 |
1066 |
params = {
|
1064 |
1067 |
'category': 'ACCEUI',
|
1065 |
1068 |
'situation': 'C',
|
1066 |
1069 |
'rl1/civility': 'M.',
|
1067 |
1070 |
'rl1/firstname': 'Jhon',
|
... | ... | |
1139 |
1142 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1140 |
1143 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1141 |
1144 |
assert resp.json['err'] == 'already-linked'
|
1142 |
1145 |
assert resp.json['err_desc'] == 'User already linked to family'
|
1143 |
1146 |
|
1144 |
1147 |
|
1145 |
1148 |
@mock.patch('passerelle.utils.Request.get')
|
1146 |
1149 |
@mock.patch('passerelle.utils.Request.post')
|
1147 |
|
def test_create_family_maelis_error(mocked_post, mocked_get, con, ref, app):
|
|
1150 |
def test_create_family_maelis_error(mocked_post, mocked_get, con, app):
|
1148 |
1151 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1149 |
1152 |
mocked_post.return_value = CREATE_FAMILY_ERR
|
1150 |
1153 |
url = get_endpoint('create-family')
|
1151 |
1154 |
params = {
|
1152 |
1155 |
'category': 'ACCEUI',
|
1153 |
1156 |
'situation': 'C',
|
1154 |
1157 |
'rl1/civility': 'M.',
|
1155 |
1158 |
'rl1/firstname': 'Jhon',
|
... | ... | |
1161 |
1164 |
'rl1/adresse/zipcode': '75014',
|
1162 |
1165 |
}
|
1163 |
1166 |
|
1164 |
1167 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1165 |
1168 |
assert resp.json['err'] == 'E54a, E54a'
|
1166 |
1169 |
assert 'Il existe déjà' in resp.json['err_desc']
|
1167 |
1170 |
|
1168 |
1171 |
|
1169 |
|
def test_create_family_wrong_referential_key_error(con, ref, app):
|
|
1172 |
def test_create_family_wrong_referential_key_error(con, app):
|
1170 |
1173 |
url = get_endpoint('create-family')
|
1171 |
1174 |
params = {
|
1172 |
1175 |
'category': 'ACCEUI',
|
1173 |
1176 |
'situation': 'C',
|
1174 |
1177 |
'rl1/civility': 'M.',
|
1175 |
1178 |
'rl1/firstname': 'Jhon',
|
1176 |
1179 |
'rl1/lastname': 'Doe',
|
1177 |
1180 |
'rl1/quality': 'AU',
|
... | ... | |
1202 |
1205 |
assert (
|
1203 |
1206 |
resp.json['err_desc']
|
1204 |
1207 |
== "childList/0/medicalRecord/vaccinList/0/code key value 'plop' do not belong to 'Vaccin' referential"
|
1205 |
1208 |
)
|
1206 |
1209 |
|
1207 |
1210 |
|
1208 |
1211 |
@mock.patch('passerelle.utils.Request.get')
|
1209 |
1212 |
@mock.patch('passerelle.utils.Request.post')
|
1210 |
|
def test_update_family(mocked_post, mocked_get, con, ref, app):
|
|
1213 |
def test_update_family(mocked_post, mocked_get, con, app):
|
1211 |
1214 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1212 |
1215 |
mocked_post.return_value = UPDATE_FAMILY
|
1213 |
1216 |
url = get_endpoint('update-family')
|
1214 |
1217 |
params = {
|
1215 |
1218 |
'category': 'BI',
|
1216 |
1219 |
'situation': 'C',
|
1217 |
1220 |
'rl1/civility': 'M.',
|
1218 |
1221 |
'rl1/firstname': 'Jhon',
|
... | ... | |
1275 |
1278 |
|
1276 |
1279 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1277 |
1280 |
assert resp.json['err'] == 'not-linked'
|
1278 |
1281 |
assert resp.json['err_desc'] == 'User not linked to family'
|
1279 |
1282 |
|
1280 |
1283 |
|
1281 |
1284 |
@mock.patch('passerelle.utils.Request.get')
|
1282 |
1285 |
@mock.patch('passerelle.utils.Request.post')
|
1283 |
|
def test_update_family_maelis_error(mocked_post, mocked_get, con, ref, app):
|
|
1286 |
def test_update_family_maelis_error(mocked_post, mocked_get, con, app):
|
1284 |
1287 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1285 |
1288 |
mocked_post.return_value = UPDATE_FAMILY_ERR
|
1286 |
1289 |
url = get_endpoint('update-family')
|
1287 |
1290 |
params = {
|
1288 |
1291 |
'category': 'ACCEUI',
|
1289 |
1292 |
'situation': 'C',
|
1290 |
1293 |
'childList/0/lastname': 'Zimmerman',
|
1291 |
1294 |
'childList/0/firstname': 'Robert',
|
... | ... | |
1297 |
1300 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1298 |
1301 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1299 |
1302 |
assert resp.json['err'] == 'E65a'
|
1300 |
1303 |
assert "E65a : Il existe déjà un enfant" in resp.json['err_desc']
|
1301 |
1304 |
|
1302 |
1305 |
|
1303 |
1306 |
@mock.patch('passerelle.utils.Request.get')
|
1304 |
1307 |
@mock.patch('passerelle.utils.Request.post')
|
1305 |
|
def test_update_family_soap_error(mocked_post, mocked_get, con, ref, app):
|
|
1308 |
def test_update_family_soap_error(mocked_post, mocked_get, con, app):
|
1306 |
1309 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1307 |
1310 |
mocked_post.return_value = UPDATE_FAMILY_500
|
1308 |
1311 |
url = get_endpoint('update-family')
|
1309 |
1312 |
params = {
|
1310 |
1313 |
'nbChild': '100',
|
1311 |
1314 |
'category': 'BI',
|
1312 |
1315 |
'situation': 'C',
|
1313 |
1316 |
'rl1/civility': 'M.',
|
... | ... | |
1321 |
1324 |
}
|
1322 |
1325 |
|
1323 |
1326 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1324 |
1327 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1325 |
1328 |
assert resp.json['err'] == 'Family-updateFamily-soap:Server'
|
1326 |
1329 |
assert 'Une erreur est survenue' in resp.json['err_desc']
|
1327 |
1330 |
|
1328 |
1331 |
|
1329 |
|
def test_update_family_wrong_referential_key_error(con, ref, app):
|
|
1332 |
def test_update_family_wrong_referential_key_error(con, app):
|
1330 |
1333 |
url = get_endpoint('update-family')
|
1331 |
1334 |
params = {
|
1332 |
1335 |
'category': 'BI',
|
1333 |
1336 |
'situation': 'C',
|
1334 |
1337 |
'rl1/civility': 'M.',
|
1335 |
1338 |
'rl1/firstname': 'Jhon',
|
1336 |
1339 |
'rl1/lastname': 'Doe',
|
1337 |
1340 |
'rl1/quality': 'AU',
|
... | ... | |
1368 |
1371 |
assert (
|
1369 |
1372 |
resp.json['err_desc']
|
1370 |
1373 |
== "childList/0/medicalRecord/vaccinList/0/code key value 'plop' do not belong to 'Vaccin' referential"
|
1371 |
1374 |
)
|
1372 |
1375 |
|
1373 |
1376 |
|
1374 |
1377 |
@mock.patch('passerelle.utils.Request.get')
|
1375 |
1378 |
@mock.patch('passerelle.utils.Request.post')
|
1376 |
|
def test_create_rl1(mocked_post, mocked_get, con, ref, app):
|
|
1379 |
def test_create_rl1(mocked_post, mocked_get, con, app):
|
1377 |
1380 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1378 |
1381 |
mocked_post.return_value = CREATE_FAMILY
|
1379 |
1382 |
url = get_endpoint('create-rl1')
|
1380 |
1383 |
params = {
|
1381 |
1384 |
'category': 'ACCEUI',
|
1382 |
1385 |
'situation': 'C',
|
1383 |
1386 |
'rl1/civility': 'M.',
|
1384 |
1387 |
'rl1/firstname': 'Jhon',
|
... | ... | |
1433 |
1436 |
}
|
1434 |
1437 |
|
1435 |
1438 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1436 |
1439 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1437 |
1440 |
assert resp.json['err'] == 'already-linked'
|
1438 |
1441 |
assert resp.json['err_desc'] == 'User already linked to family'
|
1439 |
1442 |
|
1440 |
1443 |
|
1441 |
|
def test_create_rl1_wrong_referential_key_error(con, ref, app):
|
|
1444 |
def test_create_rl1_wrong_referential_key_error(con, app):
|
1442 |
1445 |
url = get_endpoint('create-rl1')
|
1443 |
1446 |
params = {
|
1444 |
1447 |
'category': 'ACCEUI',
|
1445 |
1448 |
'situation': 'C',
|
1446 |
1449 |
'rl1/civility': 'M.',
|
1447 |
1450 |
'rl1/firstname': 'Jhon',
|
1448 |
1451 |
'rl1/lastname': 'Doe',
|
1449 |
1452 |
'rl1/quality': 'AU',
|
... | ... | |
1459 |
1462 |
assert (
|
1460 |
1463 |
resp.json['err_desc']
|
1461 |
1464 |
== "rl1/adresse/numComp key value 'plop' do not belong to 'Complement' referential"
|
1462 |
1465 |
)
|
1463 |
1466 |
|
1464 |
1467 |
|
1465 |
1468 |
@mock.patch('passerelle.utils.Request.get')
|
1466 |
1469 |
@mock.patch('passerelle.utils.Request.post')
|
1467 |
|
def test_create_rl1_maelis_error(mocked_post, mocked_get, con, ref, app):
|
|
1470 |
def test_create_rl1_maelis_error(mocked_post, mocked_get, con, app):
|
1468 |
1471 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1469 |
1472 |
mocked_post.return_value = CREATE_FAMILY_ERR
|
1470 |
1473 |
url = get_endpoint('create-rl1')
|
1471 |
1474 |
params = {
|
1472 |
1475 |
'category': 'ACCEUI',
|
1473 |
1476 |
'situation': 'C',
|
1474 |
1477 |
'rl1/civility': 'M.',
|
1475 |
1478 |
'rl1/firstname': 'Jhon',
|
... | ... | |
1483 |
1486 |
|
1484 |
1487 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1485 |
1488 |
assert resp.json['err'] == 'already-rl1'
|
1486 |
1489 |
assert 'Il existe déjà' in resp.json['err_desc']
|
1487 |
1490 |
|
1488 |
1491 |
|
1489 |
1492 |
@mock.patch('passerelle.utils.Request.get')
|
1490 |
1493 |
@mock.patch('passerelle.utils.Request.post')
|
1491 |
|
def test_update_rl1(mocked_post, mocked_get, con, ref, app):
|
|
1494 |
def test_update_rl1(mocked_post, mocked_get, con, app):
|
1492 |
1495 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1493 |
1496 |
mocked_post.side_effect = [READ_RL1_FAMILY, UPDATE_FAMILY]
|
1494 |
1497 |
url = get_endpoint('update-rl1')
|
1495 |
1498 |
params = {
|
1496 |
1499 |
'civility': 'M.',
|
1497 |
1500 |
'firstname': 'Jhonny',
|
1498 |
1501 |
'lastname': 'Doe',
|
1499 |
1502 |
'quality': 'PERE',
|
... | ... | |
1518 |
1521 |
|
1519 |
1522 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1520 |
1523 |
assert resp.json['err'] == 'not-linked'
|
1521 |
1524 |
assert resp.json['err_desc'] == 'User not linked to family'
|
1522 |
1525 |
|
1523 |
1526 |
|
1524 |
1527 |
@mock.patch('passerelle.utils.Request.get')
|
1525 |
1528 |
@mock.patch('passerelle.utils.Request.post')
|
1526 |
|
def test_update_rl1_connection_error(mocked_post, mocked_get, con, ref, app):
|
|
1529 |
def test_update_rl1_connection_error(mocked_post, mocked_get, con, app):
|
1527 |
1530 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1528 |
1531 |
mocked_post.side_effect = CONNECTION_ERROR
|
1529 |
1532 |
url = get_endpoint('update-rl1')
|
1530 |
1533 |
params = {
|
1531 |
1534 |
'civility': 'M.',
|
1532 |
1535 |
'firstname': 'Jhonny',
|
1533 |
1536 |
'lastname': 'Doe',
|
1534 |
1537 |
'quality': 'PERE',
|
... | ... | |
1536 |
1539 |
}
|
1537 |
1540 |
|
1538 |
1541 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1539 |
1542 |
resp = app.post_json(url + '?NameID=local', params=params, status=500)
|
1540 |
1543 |
assert resp.json['err']
|
1541 |
1544 |
assert resp.json['err_desc'] == 'No address associated with hostname'
|
1542 |
1545 |
|
1543 |
1546 |
|
1544 |
|
def test_update_rl1_wrong_referential_key_error(con, ref, app):
|
|
1547 |
def test_update_rl1_wrong_referential_key_error(con, app):
|
1545 |
1548 |
url = get_endpoint('update-rl1')
|
1546 |
1549 |
params = {
|
1547 |
1550 |
'civility': 'M.',
|
1548 |
1551 |
'firstname': 'Jhonny',
|
1549 |
1552 |
'lastname': 'Doe',
|
1550 |
1553 |
'quality': 'plop',
|
1551 |
1554 |
'birth/dateBirth': '1943-06-15',
|
1552 |
1555 |
}
|
... | ... | |
1554 |
1557 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1555 |
1558 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1556 |
1559 |
assert resp.json['err'] == 'wrong-key'
|
1557 |
1560 |
assert resp.json['err_desc'] == "quality key value 'plop' do not belong to 'Quality' required referential"
|
1558 |
1561 |
|
1559 |
1562 |
|
1560 |
1563 |
@mock.patch('passerelle.utils.Request.get')
|
1561 |
1564 |
@mock.patch('passerelle.utils.Request.post')
|
1562 |
|
def test_create_rl2(mocked_post, mocked_get, con, ref, app):
|
|
1565 |
def test_create_rl2(mocked_post, mocked_get, con, app):
|
1563 |
1566 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1564 |
1567 |
mocked_post.side_effect = [READ_RL1_FAMILY, UPDATE_FAMILY]
|
1565 |
1568 |
url = get_endpoint('create-rl2')
|
1566 |
1569 |
params = {
|
1567 |
1570 |
'civility': 'MME',
|
1568 |
1571 |
'firstname': 'JANE',
|
1569 |
1572 |
'lastname': 'DOE',
|
1570 |
1573 |
'maidenName': 'Smith',
|
... | ... | |
1600 |
1603 |
|
1601 |
1604 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1602 |
1605 |
assert resp.json['err'] == 'not-linked'
|
1603 |
1606 |
assert resp.json['err_desc'] == 'User not linked to family'
|
1604 |
1607 |
|
1605 |
1608 |
|
1606 |
1609 |
@mock.patch('passerelle.utils.Request.get')
|
1607 |
1610 |
@mock.patch('passerelle.utils.Request.post')
|
1608 |
|
def test_create_rl2_connection_error(mocked_post, mocked_get, con, ref, app):
|
|
1611 |
def test_create_rl2_connection_error(mocked_post, mocked_get, con, app):
|
1609 |
1612 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1610 |
1613 |
mocked_post.side_effect = CONNECTION_ERROR
|
1611 |
1614 |
url = get_endpoint('create-rl2')
|
1612 |
1615 |
params = {
|
1613 |
1616 |
'civility': 'MME',
|
1614 |
1617 |
'firstname': 'JANE',
|
1615 |
1618 |
'lastname': 'DOE',
|
1616 |
1619 |
'maidenName': 'Smith',
|
... | ... | |
1625 |
1628 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1626 |
1629 |
resp = app.post_json(url + '?NameID=local', params=params, status=500)
|
1627 |
1630 |
assert resp.json['err']
|
1628 |
1631 |
assert resp.json['err_desc'] == 'No address associated with hostname'
|
1629 |
1632 |
|
1630 |
1633 |
|
1631 |
1634 |
@mock.patch('passerelle.utils.Request.get')
|
1632 |
1635 |
@mock.patch('passerelle.utils.Request.post')
|
1633 |
|
def test_create_rl2_already_exists_error(mocked_post, mocked_get, con, ref, app):
|
|
1636 |
def test_create_rl2_already_exists_error(mocked_post, mocked_get, con, app):
|
1634 |
1637 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1635 |
1638 |
mocked_post.side_effect = [READ_FAMILY, READ_FAMILY]
|
1636 |
1639 |
url = get_endpoint('create-rl2')
|
1637 |
1640 |
params = {
|
1638 |
1641 |
'civility': 'MME',
|
1639 |
1642 |
'firstname': 'JANE',
|
1640 |
1643 |
'lastname': 'DOE',
|
1641 |
1644 |
'maidenName': 'Smith',
|
... | ... | |
1648 |
1651 |
}
|
1649 |
1652 |
|
1650 |
1653 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1651 |
1654 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1652 |
1655 |
assert resp.json['err'] == 'already-rl2'
|
1653 |
1656 |
assert resp.json['err_desc'] == 'RL2 already defined on family'
|
1654 |
1657 |
|
1655 |
1658 |
|
1656 |
|
def test_create_rl2_wrong_referential_key_error(con, ref, app):
|
|
1659 |
def test_create_rl2_wrong_referential_key_error(con, app):
|
1657 |
1660 |
url = get_endpoint('create-rl2')
|
1658 |
1661 |
params = {
|
1659 |
1662 |
'civility': 'MME',
|
1660 |
1663 |
'firstname': 'JANE',
|
1661 |
1664 |
'lastname': 'DOE',
|
1662 |
1665 |
'maidenName': 'Smith',
|
1663 |
1666 |
'quality': 'plop',
|
1664 |
1667 |
'birth/dateBirth': '1940-06-22',
|
... | ... | |
1671 |
1674 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1672 |
1675 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1673 |
1676 |
assert resp.json['err'] == 'wrong-key'
|
1674 |
1677 |
assert resp.json['err_desc'] == "quality key value 'plop' do not belong to 'Quality' required referential"
|
1675 |
1678 |
|
1676 |
1679 |
|
1677 |
1680 |
@mock.patch('passerelle.utils.Request.get')
|
1678 |
1681 |
@mock.patch('passerelle.utils.Request.post')
|
1679 |
|
def test_update_rl2(mocked_post, mocked_get, con, ref, app):
|
|
1682 |
def test_update_rl2(mocked_post, mocked_get, con, app):
|
1680 |
1683 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1681 |
1684 |
mocked_post.side_effect = [READ_FAMILY, UPDATE_FAMILY]
|
1682 |
1685 |
url = get_endpoint('update-rl2')
|
1683 |
1686 |
params = {
|
1684 |
1687 |
'civility': 'MME',
|
1685 |
1688 |
'firstname': 'JANE',
|
1686 |
1689 |
'lastname': 'DOE',
|
1687 |
1690 |
'maidenName': 'Smith',
|
... | ... | |
1708 |
1711 |
|
1709 |
1712 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1710 |
1713 |
assert resp.json['err'] == 'not-linked'
|
1711 |
1714 |
assert resp.json['err_desc'] == 'User not linked to family'
|
1712 |
1715 |
|
1713 |
1716 |
|
1714 |
1717 |
@mock.patch('passerelle.utils.Request.get')
|
1715 |
1718 |
@mock.patch('passerelle.utils.Request.post')
|
1716 |
|
def test_update_rl2_connection_error(mocked_post, mocked_get, con, ref, app):
|
|
1719 |
def test_update_rl2_connection_error(mocked_post, mocked_get, con, app):
|
1717 |
1720 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1718 |
1721 |
mocked_post.side_effect = CONNECTION_ERROR
|
1719 |
1722 |
url = get_endpoint('update-rl2')
|
1720 |
1723 |
params = {
|
1721 |
1724 |
'civility': 'MME',
|
1722 |
1725 |
'firstname': 'JANE',
|
1723 |
1726 |
'lastname': 'DOE',
|
1724 |
1727 |
'maidenName': 'Smith',
|
... | ... | |
1729 |
1732 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1730 |
1733 |
resp = app.post_json(url + '?NameID=local', params=params, status=500)
|
1731 |
1734 |
assert resp.json['err']
|
1732 |
1735 |
assert resp.json['err_desc'] == 'No address associated with hostname'
|
1733 |
1736 |
|
1734 |
1737 |
|
1735 |
1738 |
@mock.patch('passerelle.utils.Request.get')
|
1736 |
1739 |
@mock.patch('passerelle.utils.Request.post')
|
1737 |
|
def test_update_rl2_not_exists_error(mocked_post, mocked_get, con, ref, app):
|
|
1740 |
def test_update_rl2_not_exists_error(mocked_post, mocked_get, con, app):
|
1738 |
1741 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1739 |
1742 |
mocked_post.return_value = READ_RL1_FAMILY
|
1740 |
1743 |
url = get_endpoint('update-rl2')
|
1741 |
1744 |
params = {
|
1742 |
1745 |
'civility': 'MME',
|
1743 |
1746 |
'firstname': 'JANE',
|
1744 |
1747 |
'lastname': 'DOE',
|
1745 |
1748 |
'maidenName': 'Smith',
|
... | ... | |
1748 |
1751 |
}
|
1749 |
1752 |
|
1750 |
1753 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1751 |
1754 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1752 |
1755 |
assert resp.json['err'] == 'no-rl2'
|
1753 |
1756 |
assert resp.json['err_desc'] == 'No RL2 to update on family'
|
1754 |
1757 |
|
1755 |
1758 |
|
1756 |
|
def test_update_rl2_wrong_referential_key_error(con, ref, app):
|
|
1759 |
def test_update_rl2_wrong_referential_key_error(con, app):
|
1757 |
1760 |
url = get_endpoint('update-rl2')
|
1758 |
1761 |
params = {
|
1759 |
1762 |
'civility': 'MME',
|
1760 |
1763 |
'firstname': 'JANE',
|
1761 |
1764 |
'lastname': 'DOE',
|
1762 |
1765 |
'maidenName': 'Smith',
|
1763 |
1766 |
'quality': 'plop',
|
1764 |
1767 |
'birth/dateBirth': '1940-06-22',
|
... | ... | |
1767 |
1770 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1768 |
1771 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1769 |
1772 |
assert resp.json['err'] == 'wrong-key'
|
1770 |
1773 |
assert resp.json['err_desc'] == "quality key value 'plop' do not belong to 'Quality' required referential"
|
1771 |
1774 |
|
1772 |
1775 |
|
1773 |
1776 |
@mock.patch('passerelle.utils.Request.get')
|
1774 |
1777 |
@mock.patch('passerelle.utils.Request.post')
|
1775 |
|
def test_create_child(mocked_post, mocked_get, con, ref, app):
|
|
1778 |
def test_create_child(mocked_post, mocked_get, con, app):
|
1776 |
1779 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1777 |
1780 |
mocked_post.return_value = CREATE_CHILD
|
1778 |
1781 |
url = get_endpoint('create-child')
|
1779 |
1782 |
params = {
|
1780 |
1783 |
'lastname': 'DOE',
|
1781 |
1784 |
'firstname': 'JANNIS',
|
1782 |
1785 |
'sexe': 'F',
|
1783 |
1786 |
'birth/dateBirth': '1943-01-19',
|
... | ... | |
1816 |
1819 |
'birth/place': 'Port Arthur',
|
1817 |
1820 |
}
|
1818 |
1821 |
|
1819 |
1822 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1820 |
1823 |
assert resp.json['err'] == 'not-linked'
|
1821 |
1824 |
assert resp.json['err_desc'] == 'User not linked to family'
|
1822 |
1825 |
|
1823 |
1826 |
|
1824 |
|
def test_create_child_wrong_referential_key_error(con, ref, app):
|
|
1827 |
def test_create_child_wrong_referential_key_error(con, app):
|
1825 |
1828 |
url = get_endpoint('create-child')
|
1826 |
1829 |
params = {
|
1827 |
1830 |
'lastname': 'DOE',
|
1828 |
1831 |
'firstname': 'JANNIS',
|
1829 |
1832 |
'sexe': 'plop',
|
1830 |
1833 |
'birth/dateBirth': '1943-01-19',
|
1831 |
1834 |
'birth/place': 'Port Arthur',
|
1832 |
1835 |
}
|
... | ... | |
1834 |
1837 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1835 |
1838 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1836 |
1839 |
assert resp.json['err'] == 'wrong-key'
|
1837 |
1840 |
assert resp.json['err_desc'] == "sexe key value 'plop' do not belong to 'Sex' required referential"
|
1838 |
1841 |
|
1839 |
1842 |
|
1840 |
1843 |
@mock.patch('passerelle.utils.Request.get')
|
1841 |
1844 |
@mock.patch('passerelle.utils.Request.post')
|
1842 |
|
def test_create_child_connection_error(mocked_post, mocked_get, con, ref, app):
|
|
1845 |
def test_create_child_connection_error(mocked_post, mocked_get, con, app):
|
1843 |
1846 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1844 |
1847 |
mocked_post.side_effect = CONNECTION_ERROR
|
1845 |
1848 |
url = get_endpoint('create-child')
|
1846 |
1849 |
params = {
|
1847 |
1850 |
'lastname': 'DOE',
|
1848 |
1851 |
'firstname': 'JANNIS',
|
1849 |
1852 |
'sexe': 'F',
|
1850 |
1853 |
'birth/dateBirth': '1943-01-19',
|
... | ... | |
1854 |
1857 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1855 |
1858 |
resp = app.post_json(url + '?NameID=local', params=params, status=500)
|
1856 |
1859 |
assert resp.json['err']
|
1857 |
1860 |
assert resp.json['err_desc'] == 'No address associated with hostname'
|
1858 |
1861 |
|
1859 |
1862 |
|
1860 |
1863 |
@mock.patch('passerelle.utils.Request.get')
|
1861 |
1864 |
@mock.patch('passerelle.utils.Request.post')
|
1862 |
|
def test_create_child_maelis_error(mocked_post, mocked_get, con, ref, app):
|
|
1865 |
def test_create_child_maelis_error(mocked_post, mocked_get, con, app):
|
1863 |
1866 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1864 |
1867 |
mocked_post.return_value = CREATE_CHILD_ERR
|
1865 |
1868 |
url = get_endpoint('create-child')
|
1866 |
1869 |
params = {
|
1867 |
1870 |
'lastname': 'DOE',
|
1868 |
1871 |
'firstname': 'JANNIS',
|
1869 |
1872 |
'sexe': 'F',
|
1870 |
1873 |
'birth/dateBirth': '1943-01-19',
|
... | ... | |
1874 |
1877 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1875 |
1878 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1876 |
1879 |
assert resp.json['err'] == 'already-child'
|
1877 |
1880 |
assert 'Il existe déjà' in resp.json['err_desc']
|
1878 |
1881 |
|
1879 |
1882 |
|
1880 |
1883 |
@mock.patch('passerelle.utils.Request.get')
|
1881 |
1884 |
@mock.patch('passerelle.utils.Request.post')
|
1882 |
|
def test_update_child(mocked_post, mocked_get, con, ref, app):
|
|
1885 |
def test_update_child(mocked_post, mocked_get, con, app):
|
1883 |
1886 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1884 |
1887 |
mocked_post.side_effect = [READ_FAMILY, UPDATE_FAMILY]
|
1885 |
1888 |
url = get_endpoint('update-child')
|
1886 |
1889 |
params = {
|
1887 |
1890 |
'lastname': 'DOE',
|
1888 |
1891 |
'firstname': 'JANNIS',
|
1889 |
1892 |
'sexe': 'F',
|
1890 |
1893 |
'birth/dateBirth': '1943-01-19',
|
... | ... | |
1909 |
1912 |
'birth/place': 'Port Arthur',
|
1910 |
1913 |
}
|
1911 |
1914 |
|
1912 |
1915 |
resp = app.post_json(url + '?NameID=local&child_id=613880', params=params)
|
1913 |
1916 |
assert resp.json['err'] == 'not-linked'
|
1914 |
1917 |
assert resp.json['err_desc'] == 'User not linked to family'
|
1915 |
1918 |
|
1916 |
1919 |
|
1917 |
|
def test_update_child_wrong_referential_key_error(con, ref, app):
|
|
1920 |
def test_update_child_wrong_referential_key_error(con, app):
|
1918 |
1921 |
url = get_endpoint('create-child')
|
1919 |
1922 |
params = {
|
1920 |
1923 |
'lastname': 'DOE',
|
1921 |
1924 |
'firstname': 'JANNIS',
|
1922 |
1925 |
'sexe': 'plop',
|
1923 |
1926 |
'birth/dateBirth': '1943-01-19',
|
1924 |
1927 |
'birth/place': 'Port Arthur',
|
1925 |
1928 |
}
|
... | ... | |
1927 |
1930 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1928 |
1931 |
resp = app.post_json(url + '?NameID=local', params=params)
|
1929 |
1932 |
assert resp.json['err'] == 'wrong-key'
|
1930 |
1933 |
assert resp.json['err_desc'] == "sexe key value 'plop' do not belong to 'Sex' required referential"
|
1931 |
1934 |
|
1932 |
1935 |
|
1933 |
1936 |
@mock.patch('passerelle.utils.Request.get')
|
1934 |
1937 |
@mock.patch('passerelle.utils.Request.post')
|
1935 |
|
def test_update_child_connection_error(mocked_post, mocked_get, con, ref, app):
|
|
1938 |
def test_update_child_connection_error(mocked_post, mocked_get, con, app):
|
1936 |
1939 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1937 |
1940 |
mocked_post.side_effect = CONNECTION_ERROR
|
1938 |
1941 |
url = get_endpoint('update-child')
|
1939 |
1942 |
params = {
|
1940 |
1943 |
'lastname': 'DOE',
|
1941 |
1944 |
'firstname': 'JANNIS',
|
1942 |
1945 |
'sexe': 'F',
|
1943 |
1946 |
'birth/dateBirth': '1943-01-19',
|
... | ... | |
1947 |
1950 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1948 |
1951 |
resp = app.post_json(url + '?NameID=local&child_id=613880', params=params, status=500)
|
1949 |
1952 |
assert resp.json['err']
|
1950 |
1953 |
assert resp.json['err_desc'] == 'No address associated with hostname'
|
1951 |
1954 |
|
1952 |
1955 |
|
1953 |
1956 |
@mock.patch('passerelle.utils.Request.get')
|
1954 |
1957 |
@mock.patch('passerelle.utils.Request.post')
|
1955 |
|
def test_update_child_not_exists_error(mocked_post, mocked_get, con, ref, app):
|
|
1958 |
def test_update_child_not_exists_error(mocked_post, mocked_get, con, app):
|
1956 |
1959 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1957 |
1960 |
mocked_post.return_value = READ_RL1_FAMILY
|
1958 |
1961 |
url = get_endpoint('update-child')
|
1959 |
1962 |
params = {
|
1960 |
1963 |
'lastname': 'DOE',
|
1961 |
1964 |
'firstname': 'JANNIS',
|
1962 |
1965 |
'sexe': 'F',
|
1963 |
1966 |
'birth/dateBirth': '1943-01-19',
|
... | ... | |
1967 |
1970 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
1968 |
1971 |
resp = app.post_json(url + '?NameID=local&child_id=42', params=params)
|
1969 |
1972 |
assert resp.json['err'] == 'no-child'
|
1970 |
1973 |
assert resp.json['err_desc'] == 'No child 42 to update on family'
|
1971 |
1974 |
|
1972 |
1975 |
|
1973 |
1976 |
@mock.patch('passerelle.utils.Request.get')
|
1974 |
1977 |
@mock.patch('passerelle.utils.Request.post')
|
1975 |
|
def test_update_coordinate(mocked_post, mocked_get, con, ref, app):
|
|
1978 |
def test_update_coordinate(mocked_post, mocked_get, con, app):
|
1976 |
1979 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
1977 |
1980 |
mocked_post.return_value = UPDATE_FAMILY
|
1978 |
1981 |
url = get_endpoint('update-coordinate')
|
1979 |
1982 |
params = {
|
1980 |
1983 |
'adresse/num': '169',
|
1981 |
1984 |
'adresse/numComp': 'B',
|
1982 |
1985 |
'adresse/street1': 'Château',
|
1983 |
1986 |
'adresse/street2': None,
|
... | ... | |
2017 |
2020 |
}
|
2018 |
2021 |
resp = app.post_json(url + '?NameID=local&rl_id=613878', params=params, status=400)
|
2019 |
2022 |
assert resp.json['err'] == 1
|
2020 |
2023 |
assert resp.json['err_desc'] == "'true more text' is not of type 'boolean'"
|
2021 |
2024 |
|
2022 |
2025 |
|
2023 |
2026 |
@mock.patch('passerelle.utils.Request.get')
|
2024 |
2027 |
@mock.patch('passerelle.utils.Request.post')
|
2025 |
|
def test_update_coordinate_wrong_referential_key_error(mocked_post, mocked_get, con, ref, app):
|
|
2028 |
def test_update_coordinate_wrong_referential_key_error(mocked_post, mocked_get, con, app):
|
2026 |
2029 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2027 |
2030 |
mocked_post.return_value = UPDATE_FAMILY
|
2028 |
2031 |
url = get_endpoint('update-coordinate')
|
2029 |
2032 |
params = {
|
2030 |
2033 |
'adresse/num': '169',
|
2031 |
2034 |
'adresse/numComp': 'plop',
|
2032 |
2035 |
'adresse/street1': 'Château',
|
2033 |
2036 |
'adresse/street2': None,
|
... | ... | |
2040 |
2043 |
assert resp.json['err'] == 'wrong-key'
|
2041 |
2044 |
assert (
|
2042 |
2045 |
resp.json['err_desc'] == "adresse/numComp key value 'plop' do not belong to 'Complement' referential"
|
2043 |
2046 |
)
|
2044 |
2047 |
|
2045 |
2048 |
|
2046 |
2049 |
@mock.patch('passerelle.utils.Request.get')
|
2047 |
2050 |
@mock.patch('passerelle.utils.Request.post')
|
2048 |
|
def test_create_person(mocked_post, mocked_get, con, ref, app):
|
|
2051 |
def test_create_person(mocked_post, mocked_get, con, app):
|
2049 |
2052 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2050 |
2053 |
mocked_post.side_effect = [READ_FAMILY, UPDATE_FAMILY]
|
2051 |
2054 |
url = get_endpoint('create-person')
|
2052 |
2055 |
params = {
|
2053 |
2056 |
'civility': None,
|
2054 |
2057 |
'firstname': 'Mathias',
|
2055 |
2058 |
'lastname': 'Cassel',
|
2056 |
2059 |
'quality': 'O',
|
... | ... | |
2118 |
2121 |
'contact/mail': None,
|
2119 |
2122 |
}
|
2120 |
2123 |
|
2121 |
2124 |
resp = app.post_json(url + '?NameID=local', params=params)
|
2122 |
2125 |
assert resp.json['err'] == 'not-linked'
|
2123 |
2126 |
assert resp.json['err_desc'] == 'User not linked to family'
|
2124 |
2127 |
|
2125 |
2128 |
|
2126 |
|
def test_create_person_wrong_referential_key_error(con, ref, app):
|
|
2129 |
def test_create_person_wrong_referential_key_error(con, app):
|
2127 |
2130 |
url = get_endpoint('create-person')
|
2128 |
2131 |
params = {
|
2129 |
2132 |
'civility': None,
|
2130 |
2133 |
'firstname': 'Mathias',
|
2131 |
2134 |
'lastname': 'Cassel',
|
2132 |
2135 |
'quality': 'O',
|
2133 |
2136 |
'sexe': 'plop',
|
2134 |
2137 |
'dateBirth': '1972-01-01',
|
... | ... | |
2140 |
2143 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2141 |
2144 |
resp = app.post_json(url + '?NameID=local', params=params)
|
2142 |
2145 |
assert resp.json['err'] == 'wrong-key'
|
2143 |
2146 |
assert resp.json['err_desc'] == "sexe key value 'plop' do not belong to 'Sex' referential"
|
2144 |
2147 |
|
2145 |
2148 |
|
2146 |
2149 |
@mock.patch('passerelle.utils.Request.get')
|
2147 |
2150 |
@mock.patch('passerelle.utils.Request.post')
|
2148 |
|
def test_update_person(mocked_post, mocked_get, con, ref, app):
|
|
2151 |
def test_update_person(mocked_post, mocked_get, con, app):
|
2149 |
2152 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2150 |
2153 |
mocked_post.side_effect = [READ_FAMILY, UPDATE_FAMILY]
|
2151 |
2154 |
url = get_endpoint('update-person')
|
2152 |
2155 |
params = {
|
2153 |
2156 |
'civility': None,
|
2154 |
2157 |
'firstname': 'Mathias',
|
2155 |
2158 |
'lastname': 'Cassel',
|
2156 |
2159 |
'quality': 'O',
|
... | ... | |
2183 |
2186 |
|
2184 |
2187 |
resp = app.post_json(url + '?NameID=local&person_id=614059', params=params)
|
2185 |
2188 |
assert resp.json['err'] == 'not-linked'
|
2186 |
2189 |
assert resp.json['err_desc'] == 'User not linked to family'
|
2187 |
2190 |
|
2188 |
2191 |
|
2189 |
2192 |
@mock.patch('passerelle.utils.Request.get')
|
2190 |
2193 |
@mock.patch('passerelle.utils.Request.post')
|
2191 |
|
def test_update_person_not_found(mocked_post, mocked_get, con, ref, app):
|
|
2194 |
def test_update_person_not_found(mocked_post, mocked_get, con, app):
|
2192 |
2195 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2193 |
2196 |
mocked_post.return_value = READ_FAMILY
|
2194 |
2197 |
url = get_endpoint('update-person')
|
2195 |
2198 |
params = {
|
2196 |
2199 |
'civility': None,
|
2197 |
2200 |
'firstname': 'Mathias',
|
2198 |
2201 |
'lastname': 'Cassel',
|
2199 |
2202 |
'quality': 'O',
|
... | ... | |
2240 |
2243 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2241 |
2244 |
resp = app.post_json(url + '?NameID=local&person_id=000000')
|
2242 |
2245 |
assert resp.json['err'] == 'not-found'
|
2243 |
2246 |
assert resp.json['err_desc'] == "no '000000' authorized person on '1312' family"
|
2244 |
2247 |
|
2245 |
2248 |
|
2246 |
2249 |
@mock.patch('passerelle.utils.Request.get')
|
2247 |
2250 |
@mock.patch('passerelle.utils.Request.post')
|
2248 |
|
def test_create_child_person(mocked_post, mocked_get, con, ref, app):
|
|
2251 |
def test_create_child_person(mocked_post, mocked_get, con, app):
|
2249 |
2252 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2250 |
2253 |
mocked_post.side_effect = [READ_FAMILY, UPDATE_CHILD_AUTO]
|
2251 |
2254 |
url = get_endpoint('create-child-person')
|
2252 |
2255 |
params = {
|
2253 |
2256 |
'personInfo/civility': 'MME',
|
2254 |
2257 |
'personInfo/firstname': 'Diana',
|
2255 |
2258 |
'personInfo/lastname': 'Ross',
|
2256 |
2259 |
'personInfo/sexe': 'F',
|
... | ... | |
2300 |
2303 |
'personQuality/code': 'TUTEUR',
|
2301 |
2304 |
}
|
2302 |
2305 |
|
2303 |
2306 |
resp = app.post_json(url + '?NameID=local&child_id=613880', params=params)
|
2304 |
2307 |
assert resp.json['err'] == 'not-linked'
|
2305 |
2308 |
assert resp.json['err_desc'] == 'User not linked to family'
|
2306 |
2309 |
|
2307 |
2310 |
|
2308 |
|
def test_create_child_person_wrong_referential_key_error(con, ref, app):
|
|
2311 |
def test_create_child_person_wrong_referential_key_error(con, app):
|
2309 |
2312 |
url = get_endpoint('create-child-person')
|
2310 |
2313 |
params = {
|
2311 |
2314 |
'personInfo/civility': 'MME',
|
2312 |
2315 |
'personInfo/firstname': 'Diana',
|
2313 |
2316 |
'personInfo/lastname': 'Ross',
|
2314 |
2317 |
'personInfo/sexe': 'plop',
|
2315 |
2318 |
'personInfo/dateBirth': '1944-03-26',
|
2316 |
2319 |
'personInfo/contact/phone': '0199999999',
|
... | ... | |
2322 |
2325 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2323 |
2326 |
resp = app.post_json(url + '?NameID=local&child_id=613880', params=params)
|
2324 |
2327 |
assert resp.json['err'] == 'wrong-key'
|
2325 |
2328 |
assert resp.json['err_desc'] == "personInfo/sexe key value 'plop' do not belong to 'Sex' referential"
|
2326 |
2329 |
|
2327 |
2330 |
|
2328 |
2331 |
@mock.patch('passerelle.utils.Request.get')
|
2329 |
2332 |
@mock.patch('passerelle.utils.Request.post')
|
2330 |
|
def test_create_child_person_no_child_error(mocked_post, mocked_get, con, ref, app):
|
|
2333 |
def test_create_child_person_no_child_error(mocked_post, mocked_get, con, app):
|
2331 |
2334 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2332 |
2335 |
mocked_post.return_value = READ_FAMILY
|
2333 |
2336 |
url = get_endpoint('create-child-person')
|
2334 |
2337 |
params = {
|
2335 |
2338 |
'personInfo/civility': 'MME',
|
2336 |
2339 |
'personInfo/firstname': 'Diana',
|
2337 |
2340 |
'personInfo/lastname': 'Ross',
|
2338 |
2341 |
'personInfo/sexe': 'F',
|
... | ... | |
2346 |
2349 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2347 |
2350 |
resp = app.post_json(url + '?NameID=local&child_id=42', params=params)
|
2348 |
2351 |
assert resp.json['err'] == 'not-found'
|
2349 |
2352 |
assert resp.json['err_desc'] == "no '42' child on '1312' family"
|
2350 |
2353 |
|
2351 |
2354 |
|
2352 |
2355 |
@mock.patch('passerelle.utils.Request.get')
|
2353 |
2356 |
@mock.patch('passerelle.utils.Request.post')
|
2354 |
|
def test_update_child_person(mocked_post, mocked_get, con, ref, app):
|
|
2357 |
def test_update_child_person(mocked_post, mocked_get, con, app):
|
2355 |
2358 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2356 |
2359 |
mocked_post.side_effect = [READ_FAMILY, UPDATE_FAMILY]
|
2357 |
2360 |
url = get_endpoint('update-child-person')
|
2358 |
2361 |
params = {
|
2359 |
2362 |
'personInfo/civility': 'M.',
|
2360 |
2363 |
'personInfo/firstname': 'Angelo',
|
2361 |
2364 |
'personInfo/lastname': 'Bent',
|
2362 |
2365 |
'personInfo/sexe': 'M',
|
... | ... | |
2386 |
2389 |
'personQuality/code': 'O',
|
2387 |
2390 |
}
|
2388 |
2391 |
|
2389 |
2392 |
resp = app.post_json(url + '?NameID=local&child_id=613880&person_id=614719', params=params)
|
2390 |
2393 |
assert resp.json['err'] == 'not-linked'
|
2391 |
2394 |
assert resp.json['err_desc'] == 'User not linked to family'
|
2392 |
2395 |
|
2393 |
2396 |
|
2394 |
|
def test_update_child_person_wrong_referential_key_error(con, ref, app):
|
|
2397 |
def test_update_child_person_wrong_referential_key_error(con, app):
|
2395 |
2398 |
url = get_endpoint('update-child-person')
|
2396 |
2399 |
params = {
|
2397 |
2400 |
'personInfo/civility': 'M.',
|
2398 |
2401 |
'personInfo/firstname': 'Angelo',
|
2399 |
2402 |
'personInfo/lastname': 'Bent',
|
2400 |
2403 |
'personInfo/sexe': 'plop',
|
2401 |
2404 |
'personInfo/dateBirth': '1985-06-22',
|
2402 |
2405 |
'personInfo/contact/phone': '0102030405',
|
... | ... | |
2408 |
2411 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2409 |
2412 |
resp = app.post_json(url + '?NameID=local&child_id=613880&person_id=614719', params=params)
|
2410 |
2413 |
assert resp.json['err'] == 'wrong-key'
|
2411 |
2414 |
assert resp.json['err_desc'] == "personInfo/sexe key value 'plop' do not belong to 'Sex' referential"
|
2412 |
2415 |
|
2413 |
2416 |
|
2414 |
2417 |
@mock.patch('passerelle.utils.Request.get')
|
2415 |
2418 |
@mock.patch('passerelle.utils.Request.post')
|
2416 |
|
def test_update_child_person_no_child_error(mocked_post, mocked_get, con, ref, app):
|
|
2419 |
def test_update_child_person_no_child_error(mocked_post, mocked_get, con, app):
|
2417 |
2420 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2418 |
2421 |
mocked_post.return_value = READ_FAMILY
|
2419 |
2422 |
url = get_endpoint('update-child-person')
|
2420 |
2423 |
params = {
|
2421 |
2424 |
'personInfo/civility': 'M.',
|
2422 |
2425 |
'personInfo/firstname': 'Angelo',
|
2423 |
2426 |
'personInfo/lastname': 'Bent',
|
2424 |
2427 |
'personInfo/dateBirth': '1985-06-22',
|
... | ... | |
2431 |
2434 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2432 |
2435 |
resp = app.post_json(url + '?NameID=local&child_id=42&person_id=614719', params=params)
|
2433 |
2436 |
assert resp.json['err'] == 'not-found'
|
2434 |
2437 |
assert resp.json['err_desc'] == "no '42' child on '1312' family"
|
2435 |
2438 |
|
2436 |
2439 |
|
2437 |
2440 |
@mock.patch('passerelle.utils.Request.get')
|
2438 |
2441 |
@mock.patch('passerelle.utils.Request.post')
|
2439 |
|
def test_update_child_person_not_found(mocked_post, mocked_get, con, ref, app):
|
|
2442 |
def test_update_child_person_not_found(mocked_post, mocked_get, con, app):
|
2440 |
2443 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2441 |
2444 |
mocked_post.return_value = READ_FAMILY
|
2442 |
2445 |
url = get_endpoint('update-child-person')
|
2443 |
2446 |
params = {
|
2444 |
2447 |
'personInfo/civility': 'M.',
|
2445 |
2448 |
'personInfo/firstname': 'Angelo',
|
2446 |
2449 |
'personInfo/lastname': 'Bent',
|
2447 |
2450 |
'personInfo/dateBirth': '1985-06-22',
|
... | ... | |
2501 |
2504 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2502 |
2505 |
resp = app.post_json(url + '?NameID=local&child_id=613880&person_id=000000')
|
2503 |
2506 |
assert resp.json['err'] == 'not-found'
|
2504 |
2507 |
assert resp.json['err_desc'] == "No '000000' authorized person on '613880' child"
|
2505 |
2508 |
|
2506 |
2509 |
|
2507 |
2510 |
@mock.patch('passerelle.utils.Request.get')
|
2508 |
2511 |
@mock.patch('passerelle.utils.Request.post')
|
2509 |
|
def test_update_child_dietcode(mocked_post, mocked_get, con, ref, app):
|
|
2512 |
def test_update_child_dietcode(mocked_post, mocked_get, con, app):
|
2510 |
2513 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2511 |
2514 |
mocked_post.return_value = UPDATE_DIETCODE
|
2512 |
2515 |
url = get_endpoint('update-child-dietcode')
|
2513 |
2516 |
|
2514 |
2517 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2515 |
2518 |
resp = app.post_json(url + '?NameID=local&child_id=613878&dietcode=RSV')
|
2516 |
2519 |
assert_sent_payload(mocked_post, 'Q_update_child_dietcode.xml')
|
2517 |
2520 |
assert resp.json['err'] == 0
|
... | ... | |
2521 |
2524 |
def test_update_child_dietcode_not_linked_error(con, app):
|
2522 |
2525 |
url = get_endpoint('update-child-dietcode')
|
2523 |
2526 |
|
2524 |
2527 |
resp = app.post_json(url + '?NameID=local&child_id=613878&dietcode=RVS')
|
2525 |
2528 |
assert resp.json['err'] == 'not-linked'
|
2526 |
2529 |
assert resp.json['err_desc'] == 'User not linked to family'
|
2527 |
2530 |
|
2528 |
2531 |
|
2529 |
|
def test_update_child_dietcode_wrong_referential_key_error(con, ref, app):
|
|
2532 |
def test_update_child_dietcode_wrong_referential_key_error(con, app):
|
2530 |
2533 |
url = get_endpoint('update-child-dietcode')
|
2531 |
2534 |
|
2532 |
2535 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2533 |
2536 |
resp = app.post_json(url + '?NameID=local&child_id=613878&dietcode=plop')
|
2534 |
2537 |
assert resp.json['err'] == 'wrong-key'
|
2535 |
2538 |
assert (
|
2536 |
2539 |
resp.json['err_desc'] == "dietcode parameter key value 'plop' do not belong to 'DietCode' referential"
|
2537 |
2540 |
)
|
2538 |
2541 |
|
2539 |
2542 |
|
2540 |
2543 |
@mock.patch('passerelle.utils.Request.get')
|
2541 |
2544 |
@mock.patch('passerelle.utils.Request.post')
|
2542 |
|
def test_update_child_pai(mocked_post, mocked_get, con, ref, app):
|
|
2545 |
def test_update_child_pai(mocked_post, mocked_get, con, app):
|
2543 |
2546 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2544 |
2547 |
mocked_post.return_value = UPDATE_PAI
|
2545 |
2548 |
url = get_endpoint('update-child-pai')
|
2546 |
2549 |
params = {
|
2547 |
2550 |
'code': 'PAIALI',
|
2548 |
2551 |
'dateDeb': '2022-01-01',
|
2549 |
2552 |
'dateFin': '',
|
2550 |
2553 |
'description': 'some text',
|
... | ... | |
2602 |
2605 |
|
2603 |
2606 |
resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
|
2604 |
2607 |
assert resp.json['err'] == 'not-linked'
|
2605 |
2608 |
assert resp.json['err_desc'] == 'User not linked to family'
|
2606 |
2609 |
|
2607 |
2610 |
|
2608 |
2611 |
@mock.patch('passerelle.utils.Request.get')
|
2609 |
2612 |
@mock.patch('passerelle.utils.Request.post')
|
2610 |
|
def test_update_child_pai_soap_error(mocked_post, mocked_get, con, ref, app):
|
|
2613 |
def test_update_child_pai_soap_error(mocked_post, mocked_get, con, app):
|
2611 |
2614 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2612 |
2615 |
mocked_post.return_value = UPDATE_PAI_500
|
2613 |
2616 |
url = get_endpoint('update-child-pai')
|
2614 |
2617 |
params = {
|
2615 |
2618 |
'code': 'PAIALI',
|
2616 |
2619 |
'dateDeb': '2022-01-01',
|
2617 |
2620 |
'dateFin': '',
|
2618 |
2621 |
'description': 'a' * 501,
|
... | ... | |
2623 |
2626 |
assert resp.json['err'] == 'Family-updateChildPAI-soap:Server'
|
2624 |
2627 |
assert 'Une erreur est survenue' in resp.json['err_desc']
|
2625 |
2628 |
assert 'valeur trop grande' in resp.json['err_desc']
|
2626 |
2629 |
assert 'maximum : 500' in resp.json['err_desc']
|
2627 |
2630 |
|
2628 |
2631 |
|
2629 |
2632 |
@mock.patch('passerelle.utils.Request.get')
|
2630 |
2633 |
@mock.patch('passerelle.utils.Request.post')
|
2631 |
|
def test_update_child_medical_record(mocked_post, mocked_get, con, ref, app):
|
|
2634 |
def test_update_child_medical_record(mocked_post, mocked_get, con, app):
|
2632 |
2635 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2633 |
2636 |
mocked_post.return_value = UPDATE_MEDICAL
|
2634 |
2637 |
url = get_endpoint('update-child-medical-record')
|
2635 |
2638 |
params = {
|
2636 |
2639 |
'familyDoctor/name': 'Dre',
|
2637 |
2640 |
'familyDoctor/phone': '0612341234',
|
2638 |
2641 |
'familyDoctor/address/street1': 'Alameda',
|
2639 |
2642 |
'familyDoctor/address/zipcode': '90220',
|
... | ... | |
2656 |
2659 |
resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
|
2657 |
2660 |
assert_sent_payload(mocked_post, 'Q_update_child_medical_record.xml')
|
2658 |
2661 |
assert resp.json['err'] == 0
|
2659 |
2662 |
assert resp.json['data'] == 'ok'
|
2660 |
2663 |
|
2661 |
2664 |
|
2662 |
2665 |
@mock.patch('passerelle.utils.Request.get')
|
2663 |
2666 |
@mock.patch('passerelle.utils.Request.post')
|
2664 |
|
def test_update_child_medical_record_with_empty_vaccin_list(mocked_post, mocked_get, con, ref, app):
|
|
2667 |
def test_update_child_medical_record_with_empty_vaccin_list(mocked_post, mocked_get, con, app):
|
2665 |
2668 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2666 |
2669 |
mocked_post.return_value = UPDATE_MEDICAL
|
2667 |
2670 |
url = get_endpoint('update-child-medical-record')
|
2668 |
2671 |
params = {
|
2669 |
2672 |
'familyDoctor/name': 'Dre',
|
2670 |
2673 |
'familyDoctor/phone': '0612341234',
|
2671 |
2674 |
'familyDoctor/address/street1': 'Alameda',
|
2672 |
2675 |
'familyDoctor/address/zipcode': '90220',
|
... | ... | |
2692 |
2695 |
|
2693 |
2696 |
resp = app.post_json(url + '?NameID=local&child_id=613878', params={})
|
2694 |
2697 |
assert resp.json['err'] == 'not-linked'
|
2695 |
2698 |
assert resp.json['err_desc'] == 'User not linked to family'
|
2696 |
2699 |
|
2697 |
2700 |
|
2698 |
2701 |
@mock.patch('passerelle.utils.Request.get')
|
2699 |
2702 |
@mock.patch('passerelle.utils.Request.post')
|
2700 |
|
def test_update_child_medical_record_soap_error(mocked_post, mocked_get, con, ref, app):
|
|
2703 |
def test_update_child_medical_record_soap_error(mocked_post, mocked_get, con, app):
|
2701 |
2704 |
mocked_get.return_value = FAMILY_SERVICE_WSDL
|
2702 |
2705 |
mocked_post.return_value = UPDATE_MEDICAL_500
|
2703 |
2706 |
url = get_endpoint('update-child-medical-record')
|
2704 |
2707 |
params = {
|
2705 |
2708 |
'vaccinList/0/code': 'DTC',
|
2706 |
2709 |
'vaccinList/0/vaccinationDate': '2022-02-31',
|
2707 |
2710 |
}
|
2708 |
2711 |
|
2709 |
2712 |
Link.objects.create(resource=con, family_id='1312', name_id='local')
|
2710 |
2713 |
resp = app.post_json(url + '?NameID=local&child_id=613878', params=params)
|
2711 |
2714 |
assert resp.json['err'] == 'Family-updateChildMedicalRecord-soap:Client'
|
2712 |
2715 |
assert 'Unmarshalling Error' in resp.json['err_desc']
|
2713 |
2716 |
assert 'pas une valeur de calendrier grégorien' in resp.json['err_desc']
|
2714 |
2717 |
|
2715 |
2718 |
|
2716 |
|
def test_update_child_medical_record_wrong_referential_key_error(con, ref, app):
|
|
2719 |
def test_update_child_medical_record_wrong_referential_key_error(con, app):
|
2717 |
2720 |
url = get_endpoint('update-child-medical-record')
|
2718 |
2721 |
params = {
|
2719 |
2722 |
'familyDoctor/name': 'Dre',
|
2720 |
2723 |
'familyDoctor/phone': '0612341234',
|
2721 |
2724 |
'familyDoctor/address/street1': 'Alameda',
|
2722 |
2725 |
'familyDoctor/address/zipcode': '90220',
|
2723 |
2726 |
'familyDoctor/address/town': 'Compton',
|
2724 |
2727 |
'vaccinList/0/code': 'DTC',
|