Project

General

Profile

0001-toulouse_parsifal-unset-default-date-on-emergency-pe.patch

Nicolas Roche, 13 September 2022 07:53 PM

Download (3.09 KB)

View differences:

Subject: [PATCH] toulouse_parsifal: unset default date on emergency person
 (#69047)

 passerelle/contrib/toulouse_maelis/models.py   | 1 -
 tests/data/toulouse_maelis/Q_create_person.xml | 2 +-
 tests/test_toulouse_maelis.py                  | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)
passerelle/contrib/toulouse_maelis/models.py
120 120

  
121 121
    def get_family_raw(self, family_id):
122 122
        response = self.call('Family', 'readFamily', dossierNumber=family_id)
123 123
        data = serialize_object(response)
124 124

  
125 125
        # make emergencyPersonList keys egal to authorizedPersonList
126 126
        for person in data['emergencyPersonList']:
127 127
            person['numPerson'] = person['num']
128
            person['dateBirth'] = '1970-01-01'  # I need a date
129 128
            del person['num']
130 129
            del person['id']
131 130
        return data
132 131

  
133 132
    def get_family(self, family_id):
134 133
        data = self.get_family_raw(family_id)
135 134

  
136 135
        def add_text_value(referential_name, data, keys):
tests/data/toulouse_maelis/Q_create_person.xml
14 14
      <categorie>BI</categorie>
15 15
      <situation>M</situation>
16 16
      <emergencyPersonList>
17 17
        <personList>
18 18
          <numPerson>614059</numPerson>
19 19
          <civility>MME</civility>
20 20
          <firstname>KENY</firstname>
21 21
          <lastname>ARKANA</lastname>
22
          <dateBirth>1970-01-01</dateBirth>
22
          <dateBirth>1982-12-20T00:00:00+01:00</dateBirth>
23 23
          <quality>T</quality>
24 24
          <contact>
25 25
            <phone>0123456789</phone>
26 26
            <mail>pueblo@example.org</mail>
27 27
          </contact>
28 28
        </personList>
29 29
        <personList>
30 30
          <civility/>
tests/test_toulouse_maelis.py
650 650
                "label": "ROUGEOLE-OREILLONS-RUBEOLE",
651 651
                "vaccinationDate": "1970-01-11T00:00:00+01:00",
652 652
            },
653 653
        ],
654 654
    }
655 655
    assert resp.json['data']['emergencyPersonList'][0] == {
656 656
        'firstname': 'KENY',
657 657
        'lastname': 'ARKANA',
658
        'dateBirth': '1970-01-01',
658
        'dateBirth': '1982-12-20T00:00:00+01:00',
659 659
        'quality': 'T',
660 660
        'civility': 'MME',
661 661
        'contact': {'phone': '0123456789', 'mobile': None, 'mail': 'pueblo@example.org'},
662 662
        'numPerson': 614059,
663 663
        'civility_text': 'Madame',
664 664
        'quality_text': 'TANTE',
665 665
    }
666 666

  
667
-