toulouse-maelis: add test content (#70075)

This commit is contained in:
Nicolas Roche 2022-10-20 02:00:38 +02:00
parent 016fe427b4
commit 45ae4d3cf3
5 changed files with 119 additions and 3 deletions

View File

@ -19,11 +19,30 @@
<civility>M.</civility>
<dateBirth>1938-07-26</dateBirth>
<adresse>
<numComp>B</numComp>
<street1>Chateau</street1>
<town>Paris</town>
<zipcode>75014</zipcode>
</adresse>
<profession>
<codeCSP>ART</codeCSP>
</profession>
<CAFInfo>
<organ>A10007752822</organ>
</CAFInfo>
</rl1>
<childList>
<sexe>M</sexe>
<lastname>Zimmerman</lastname>
<firstname>Robert</firstname>
<dateBirth>1941-05-24</dateBirth>
<dietcode>RSV</dietcode>
<medicalRecord>
<vaccinList>
<code>DTC</code>
</vaccinList>
</medicalRecord>
</childList>
</ns0:createFamily>
</soap-env:Body>
</soap-env:Envelope>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>maelis-webservice</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">maelis-password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<ns0:createFamily xmlns:ns0="family.ws.maelis.sigec.com">
<categorie>ACCEUI</categorie>
<situation>C</situation>
<rl1>
<lastname>Doe</lastname>
<firstname>Jhon</firstname>
<quality>AU</quality>
<civility>M.</civility>
<dateBirth>1938-07-26</dateBirth>
<adresse>
<street1>Chateau</street1>
<town>Paris</town>
<zipcode>75014</zipcode>
</adresse>
</rl1>
</ns0:createFamily>
</soap-env:Body>
</soap-env:Envelope>

View File

@ -14,12 +14,28 @@
<numPerson>613878</numPerson>
<adresse>
<num>169</num>
<numComp/>
<numComp>B</numComp>
<street1>Château</street1>
<street2/>
<town>Paris</town>
<zipcode>75014</zipcode>
</adresse>
<profession>
<codeCSP>ART</codeCSP>
<profession>informaticien</profession>
<employerName>EO</employerName>
<phone>0123456789</phone>
<addressPro>
<num/>
<street/>
<zipcode/>
<town>Orl&#233;ans</town>
</addressPro>
</profession>
<CAFInfo>
<number>789</number>
<organ>A10007752822</organ>
</CAFInfo>
</ns0:updateCoordinate>
</soap-env:Body>
</soap-env:Envelope>

View File

@ -20,11 +20,36 @@
<civility>M.</civility>
<dateBirth>1938-07-26</dateBirth>
<adresse>
<numComp>B</numComp>
<street1>Chateau</street1>
<town>Paris</town>
<zipcode>75014</zipcode>
</adresse>
<profession>
<codeCSP>ART</codeCSP>
</profession>
<CAFInfo>
<organ>A10007752822</organ>
</CAFInfo>
</rl1>
<childList>
<lastname>Zimmerman</lastname>
<firstname>Robert</firstname>
<sexe>M</sexe>
<birth>
<dateBirth>1941-05-24</dateBirth>
<place>Duluth</place>
</birth>
<dietcode>RSV</dietcode>
<medicalRecord>
<vaccinList>
<code>DTC</code>
</vaccinList>
</medicalRecord>
<paiInfoBean>
<code>PAIALI</code>
</paiInfoBean>
</childList>
</ns0:updateFamily>
</soap-env:Body>
</soap-env:Envelope>

View File

@ -1050,6 +1050,15 @@ def test_create_family(mocked_post, mocked_get, con, app):
'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/dateBirth': '1941-05-24',
'childList/0/dietcode': 'RSV',
'childList/0/medicalRecord/vaccinList/0/code': 'DTC',
}
resp = app.post_json(url + '?NameID=local', params=params)
@ -1146,6 +1155,17 @@ def test_update_family(mocked_post, mocked_get, con, app):
'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')
@ -1242,7 +1262,7 @@ def test_create_rl1(mocked_post, mocked_get, con, app):
}
resp = app.post_json(url + '?NameID=local', params=params)
assert_sent_payload(mocked_post, 'Q_create_family.xml')
assert_sent_payload(mocked_post, 'Q_create_rl1.xml')
assert resp.json['err'] == 0
assert resp.json['data'] == {'family_id': 196545}
assert Link.objects.get(resource=con, family_id='196545', name_id='local')
@ -1711,11 +1731,18 @@ def test_update_coordinate(mocked_post, mocked_get, con, app):
url = get_endpoint('update-coordinate')
params = {
'adresse/num': '169',
'adresse/numComp': None,
'adresse/numComp': 'B',
'adresse/street1': 'Château',
'adresse/street2': None,
'adresse/town': 'Paris',
'adresse/zipcode': '75014',
'profession/codeCSP': 'ART',
'profession/profession': 'informaticien',
'profession/employerName': 'EO',
'profession/phone': '0123456789',
'profession/addressPro': {'num': None, 'street': None, 'zipcode': None, 'town': 'Orléans'},
'CAFInfo/number': '789',
'CAFInfo/organ': 'A10007752822',
}
Link.objects.create(resource=con, family_id='1312', name_id='local')