Projet

Général

Profil

0005-toulouse-maelis-add-new-fields-71641.patch

Nicolas Roche (absent jusqu'au 3 avril), 24 novembre 2022 11:14

Télécharger (4,44 ko)

Voir les différences:

Subject: [PATCH 5/6] toulouse-maelis: add new fields (#71641)

 tests/test_toulouse_maelis.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
tests/test_toulouse_maelis.py
579 579
        'situation_text': 'Marié (e)',
580 580
    }
581 581
    data = resp.json['data']['RL1']
582 582
    del data['profession']
583 583
    assert data == {
584 584
        'num': '613878',
585 585
        'lastname': 'DOE',
586 586
        'firstname': 'JHON',
587
        'maidenName': None,
587 588
        'quality': 'PERE',
588 589
        'civility': 'M.',
589 590
        'dateBirth': '1938-07-26T00:00:00+01:00',
590 591
        'adresse': {
591 592
            'idStreet': None,
592 593
            'num': 170,
593 594
            'numComp': None,
594 595
            'street1': "Chateau d'eau",
......
603 604
            'isContactMail': True,
604 605
            'isContactSms': True,
605 606
            'isInvoicePdf': True,
606 607
        },
607 608
        'CAFInfo': None,
608 609
        'civility_text': 'Monsieur',
609 610
        'quality_text': 'PERE',
610 611
        'quotientList': [],
612
        'indicatorList': [],
611 613
        'subscribeActivityList': [],
612 614
    }
613 615
    data = resp.json['data']['childList'][0]
614 616
    del data['medicalRecord']
615 617
    del data['authorizedPersonList']
616 618
    del data['paiInfoBean']
617 619
    assert data == {
618 620
        'num': '613880',
......
620 622
        'firstname': 'JANNIS',
621 623
        'sexe': 'F',
622 624
        'sexe_text': 'Féminin',
623 625
        'birth': {'dateBirth': '1943-01-19T00:00:00+01:00', 'place': None},
624 626
        'dietcode': 'RSV',
625 627
        'dietcode_text': '3- RÉGIME SANS VIANDE',
626 628
        'bPhoto': True,
627 629
        'bLeaveAlone': False,
630
        'insurance': None,
628 631
        'indicatorList': [],
629 632
        'subscribeSchoolList': [],
630 633
        'mother': {'num': 613963, 'civility': 'MME', 'firstname': 'JANE', 'lastname': 'DOE'},
631 634
        'father': {'num': 613878, 'civility': 'M.', 'firstname': 'JHON', 'lastname': 'DOE'},
632 635
        'rl': None,
633 636
        'subscribeActivityList': [],
634 637
    }
635 638
    if read_family != READ_FAMILY_LAX:
......
648 651
            'description': 'bla bla PAI',
649 652
        }
650 653
    assert resp.json['data']['childList'][0]['medicalRecord'] == {
651 654
        "familyDoctor": {
652 655
            "name": "DRE",
653 656
            "phone": "0612341234",
654 657
            "address": {"street1": "Alameda", "zipcode": "90220", "town": "Compton"},
655 658
        },
659
        'allergy1': None,
660
        'allergy2': None,
661
        'comment1': None,
662
        'comment2': None,
663
        'hospital': None,
664
        'isAuthHospital': None,
665
        'observ1': None,
666
        'observ2': None,
656 667
        "vaccinList": [
657 668
            {
658 669
                "code": "ROR",
659 670
                "label": "ROUGEOLE-OREILLONS-RUBEOLE",
660 671
                "vaccinationDate": "2012-02-22T00:00:00+01:00",
661 672
            },
662 673
            {
663 674
                "code": "DTC",
......
744 755
    Link.objects.create(resource=con, family_id='1312', name_id='local')
745 756

  
746 757
    resp = app.get(url + '?NameID=local&rl_id=613879')
747 758
    assert resp.json['err'] == 0
748 759
    assert resp.json['data'] == {
749 760
        'num': '613879',
750 761
        'lastname': 'DOE',
751 762
        'firstname': 'JANE',
763
        'maidenName': None,
752 764
        'quality': 'MERE',
753 765
        'civility': 'MME',
754 766
        'dateBirth': '1940-06-22T00:00:00+02:00',
755 767
        'adresse': {
756 768
            'idStreet': None,
757 769
            'num': 170,
758 770
            'numComp': None,
759 771
            'street1': "Chateau d'eau",
......
780 792
        'CAFInfo': {
781 793
            'number': '789',
782 794
            'organ': 'A10007752822',
783 795
            'organ_text': 'LA COLLE SUR LOUP',
784 796
        },
785 797
        'civility_text': 'Madame',
786 798
        'quality_text': 'MERE',
787 799
        'quotientList': [],
800
        'indicatorList': [],
788 801
        'subscribeActivityList': [],
789 802
    }
790 803

  
791 804

  
792 805
def test_read_rl_not_linked_error(con, app):
793 806
    url = get_endpoint('read-rl')
794 807

  
795 808
    resp = app.get(url + '?NameID=local&rl_id=613879')
796
-