toulouse-maelis: rename category field (#71641)
This commit is contained in:
parent
da33488040
commit
2d34e5b032
|
@ -319,12 +319,12 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
self.assert_update_coordinate_payload_in_referential(post_data, keys)
|
||||
|
||||
def assert_create_rl1_payload_in_referential(self, post_data):
|
||||
self.assert_post_data_in_referential('Category', post_data, ['categorie'])
|
||||
self.assert_post_data_in_referential('Category', post_data, ['category'])
|
||||
self.assert_post_data_in_referential('Situation', post_data, ['situation'])
|
||||
self.assert_rl_payload_in_referential(post_data, ['rl1'])
|
||||
|
||||
def assert_family_payload_in_referential(self, post_data):
|
||||
self.assert_post_data_in_referential('Category', post_data, ['categorie'])
|
||||
self.assert_post_data_in_referential('Category', post_data, ['category'])
|
||||
self.assert_post_data_in_referential('Situation', post_data, ['situation'])
|
||||
for rlg in 'rl1', 'rl2':
|
||||
if rlg in post_data:
|
||||
|
@ -679,7 +679,7 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
rl1['adresse'] = family['RL1']['adresse']
|
||||
payload = {
|
||||
'dossierNumber': family_id,
|
||||
'categorie': family['category'],
|
||||
'category': family['category'],
|
||||
'situation': family['situation'],
|
||||
'flagCom': family['flagCom'],
|
||||
'nbChild': family['nbChild'],
|
||||
|
@ -707,7 +707,7 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
|
||||
payload = {
|
||||
'dossierNumber': family_id,
|
||||
'categorie': family['category'],
|
||||
'category': family['category'],
|
||||
'situation': family['situation'],
|
||||
'flagCom': family['flagCom'],
|
||||
'nbChild': family['nbChild'],
|
||||
|
@ -739,7 +739,7 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
rl2['adresse'] = family['RL2']['adresse']
|
||||
payload = {
|
||||
'dossierNumber': family_id,
|
||||
'categorie': family['category'],
|
||||
'category': family['category'],
|
||||
'situation': family['situation'],
|
||||
'flagCom': family['flagCom'],
|
||||
'nbChild': family['nbChild'],
|
||||
|
@ -805,7 +805,7 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
child['num'] = child_id
|
||||
payload = {
|
||||
'dossierNumber': family_id,
|
||||
'categorie': family['category'],
|
||||
'category': family['category'],
|
||||
'situation': family['situation'],
|
||||
'flagCom': family['flagCom'],
|
||||
'nbChild': family['nbChild'],
|
||||
|
@ -854,7 +854,7 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
personList.append(post_data)
|
||||
payload = {
|
||||
'dossierNumber': family_id,
|
||||
'categorie': family['category'],
|
||||
'category': family['category'],
|
||||
'situation': family['situation'],
|
||||
'flagCom': family['flagCom'],
|
||||
'nbChild': family['nbChild'],
|
||||
|
@ -893,7 +893,7 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
)
|
||||
payload = {
|
||||
'dossierNumber': family_id,
|
||||
'categorie': family['category'],
|
||||
'category': family['category'],
|
||||
'situation': family['situation'],
|
||||
'flagCom': family['flagCom'],
|
||||
'nbChild': family['nbChild'],
|
||||
|
@ -930,7 +930,7 @@ class ToulouseMaelis(BaseResource, HTTPResource):
|
|||
)
|
||||
payload = {
|
||||
'dossierNumber': family_id,
|
||||
'categorie': family['category'],
|
||||
'category': family['category'],
|
||||
'situation': family['situation'],
|
||||
'flagCom': family['flagCom'],
|
||||
'nbChild': family['nbChild'],
|
||||
|
|
|
@ -470,10 +470,10 @@ UPDATE_FAMILY_SCHEMA = {
|
|||
'title': 'Family',
|
||||
'description': 'Informations pour créer ou mettre à jour une famille',
|
||||
'type': 'object',
|
||||
'required': ['categorie', 'situation'],
|
||||
'required': ['category', 'situation'],
|
||||
'properties': {
|
||||
'categorie': {
|
||||
'description': 'Categorie (depuis référentiel)',
|
||||
'category': {
|
||||
'description': 'Catégorie (depuis référentiel)',
|
||||
'type': 'string',
|
||||
'pattern': '.+',
|
||||
},
|
||||
|
@ -524,7 +524,7 @@ UPDATE_FAMILY_SCHEMA = {
|
|||
}
|
||||
|
||||
CREATE_FAMILY_SCHEMA = copy.deepcopy(UPDATE_FAMILY_SCHEMA)
|
||||
CREATE_FAMILY_SCHEMA['required'] = ['rl1', 'categorie', 'situation']
|
||||
CREATE_FAMILY_SCHEMA['required'] = ['rl1', 'category', 'situation']
|
||||
create_family_child_schema = CREATE_FAMILY_SCHEMA['properties']['childList']['oneOf'][0]['items']
|
||||
del create_family_child_schema['properties']['bPhoto']
|
||||
del create_family_child_schema['properties']['bLeaveAlone']
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</soap-env:Header>
|
||||
<soap-env:Body>
|
||||
<ns0:createFamily xmlns:ns0="family.ws.maelis.sigec.com">
|
||||
<categorie>ACCEUI</categorie>
|
||||
<category>ACCEUI</category>
|
||||
<situation>C</situation>
|
||||
<rl1>
|
||||
<lastname>Doe</lastname>
|
||||
|
@ -32,9 +32,9 @@
|
|||
</CAFInfo>
|
||||
</rl1>
|
||||
<childList>
|
||||
<sexe>M</sexe>
|
||||
<lastname>Zimmerman</lastname>
|
||||
<firstname>Robert</firstname>
|
||||
<lastname>Zimmerman</lastname>
|
||||
<sexe>M</sexe>
|
||||
<dateBirth>1941-05-24</dateBirth>
|
||||
<dietcode>RSV</dietcode>
|
||||
<medicalRecord>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<soap-env:Body>
|
||||
<ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
|
||||
<dossierNumber>1312</dossierNumber>
|
||||
<categorie>BI</categorie>
|
||||
<category>BI</category>
|
||||
<situation>M</situation>
|
||||
<flagCom>true</flagCom>
|
||||
<nbChild>2</nbChild>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</soap-env:Header>
|
||||
<soap-env:Body>
|
||||
<ns0:createFamily xmlns:ns0="family.ws.maelis.sigec.com">
|
||||
<categorie>ACCEUI</categorie>
|
||||
<category>ACCEUI</category>
|
||||
<situation>C</situation>
|
||||
<rl1>
|
||||
<lastname>Doe</lastname>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<soap-env:Body>
|
||||
<ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
|
||||
<dossierNumber>1312</dossierNumber>
|
||||
<categorie>BI</categorie>
|
||||
<category>BI</category>
|
||||
<situation>M</situation>
|
||||
<flagCom>true</flagCom>
|
||||
<nbChild>2</nbChild>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<soap-env:Body>
|
||||
<ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
|
||||
<dossierNumber>1312</dossierNumber>
|
||||
<categorie>BI</categorie>
|
||||
<category>BI</category>
|
||||
<situation>M</situation>
|
||||
<flagCom>true</flagCom>
|
||||
<nbChild>2</nbChild>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<soap-env:Body>
|
||||
<ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
|
||||
<dossierNumber>1312</dossierNumber>
|
||||
<categorie>BI</categorie>
|
||||
<category>BI</category>
|
||||
<situation>M</situation>
|
||||
<flagCom>true</flagCom>
|
||||
<nbChild>2</nbChild>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<soap-env:Body>
|
||||
<ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
|
||||
<dossierNumber>1312</dossierNumber>
|
||||
<categorie>BI</categorie>
|
||||
<category>BI</category>
|
||||
<situation>C</situation>
|
||||
<rl1>
|
||||
<lastname>Doe</lastname>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<soap-env:Body>
|
||||
<ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
|
||||
<dossierNumber>1312</dossierNumber>
|
||||
<categorie>BI</categorie>
|
||||
<category>BI</category>
|
||||
<situation>M</situation>
|
||||
<flagCom>true</flagCom>
|
||||
<nbChild>2</nbChild>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<soap-env:Body>
|
||||
<ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
|
||||
<dossierNumber>1312</dossierNumber>
|
||||
<categorie>BI</categorie>
|
||||
<category>BI</category>
|
||||
<situation>M</situation>
|
||||
<flagCom>true</flagCom>
|
||||
<nbChild>2</nbChild>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<soap-env:Body>
|
||||
<ns0:updateFamily xmlns:ns0="family.ws.maelis.sigec.com">
|
||||
<dossierNumber>1312</dossierNumber>
|
||||
<categorie>BI</categorie>
|
||||
<category>BI</category>
|
||||
<situation>M</situation>
|
||||
<flagCom>true</flagCom>
|
||||
<nbChild>2</nbChild>
|
||||
|
|
|
@ -1027,7 +1027,7 @@ def test_create_family(mocked_post, mocked_get, con, app):
|
|||
]
|
||||
url = get_endpoint('create-family')
|
||||
params = {
|
||||
'categorie': 'ACCEUI',
|
||||
'category': 'ACCEUI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1063,8 +1063,8 @@ def test_create_family(mocked_post, mocked_get, con, app):
|
|||
def test_create_family_empty_referential_key_error(con, app):
|
||||
url = get_endpoint('create-family')
|
||||
params = {
|
||||
'categorie': '',
|
||||
'situation': '',
|
||||
'category': '',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
'rl1/lastname': 'Doe',
|
||||
|
@ -1077,13 +1077,13 @@ def test_create_family_empty_referential_key_error(con, app):
|
|||
|
||||
resp = app.post_json(url + '?NameID=local', params=params, status=400)
|
||||
assert resp.json['err'] == 1
|
||||
assert resp.json['err_desc'] == "categorie: '' does not match '.+'"
|
||||
assert resp.json['err_desc'] == "category: '' does not match '.+'"
|
||||
|
||||
|
||||
def test_create_family_already_linked_error(con, app):
|
||||
url = get_endpoint('create-family')
|
||||
params = {
|
||||
'categorie': 'ACCEUI',
|
||||
'category': 'ACCEUI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1114,7 +1114,7 @@ def test_create_family_maelis_error(mocked_post, mocked_get, con, app):
|
|||
]
|
||||
url = get_endpoint('create-family')
|
||||
params = {
|
||||
'categorie': 'ACCEUI',
|
||||
'category': 'ACCEUI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1147,7 +1147,7 @@ def test_create_family_wrong_referential_key_error(mocked_post, mocked_get, con,
|
|||
]
|
||||
url = get_endpoint('create-family')
|
||||
params = {
|
||||
'categorie': 'ACCEUI',
|
||||
'category': 'ACCEUI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1194,7 +1194,7 @@ def test_update_family(mocked_post, mocked_get, con, app):
|
|||
]
|
||||
url = get_endpoint('update-family')
|
||||
params = {
|
||||
'categorie': 'BI',
|
||||
'category': 'BI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1234,7 +1234,7 @@ def test_update_family(mocked_post, mocked_get, con, app):
|
|||
def test_update_family_not_linked_error(con, app):
|
||||
url = get_endpoint('update-family')
|
||||
params = {
|
||||
'categorie': 'BI',
|
||||
'category': 'BI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1262,7 +1262,7 @@ def test_update_family_maelis_error(mocked_post, mocked_get, con, app):
|
|||
]
|
||||
url = get_endpoint('update-family')
|
||||
params = {
|
||||
'categorie': 'ACCEUI',
|
||||
'category': 'ACCEUI',
|
||||
'situation': 'C',
|
||||
'childList/0/lastname': 'Zimmerman',
|
||||
'childList/0/firstname': 'Robert',
|
||||
|
@ -1285,7 +1285,7 @@ def test_update_family_soap_error(mocked_post, mocked_get, con, app):
|
|||
url = get_endpoint('update-family')
|
||||
params = {
|
||||
'nbChild': '100',
|
||||
'categorie': 'BI',
|
||||
'category': 'BI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1320,7 +1320,7 @@ def test_update_family_wrong_referential_key_error(mocked_post, mocked_get, con,
|
|||
]
|
||||
url = get_endpoint('update-family')
|
||||
params = {
|
||||
'categorie': 'BI',
|
||||
'category': 'BI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1371,7 +1371,7 @@ def test_create_rl1(mocked_post, mocked_get, con, app):
|
|||
]
|
||||
url = get_endpoint('create-rl1')
|
||||
params = {
|
||||
'categorie': 'ACCEUI',
|
||||
'category': 'ACCEUI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1393,7 +1393,7 @@ def test_create_rl1(mocked_post, mocked_get, con, app):
|
|||
def test_create_rl1_empty_referential_key_error(con, app):
|
||||
url = get_endpoint('create-rl1')
|
||||
params = {
|
||||
'categorie': 'ACCEUI',
|
||||
'category': 'ACCEUI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': '',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1413,7 +1413,7 @@ def test_create_rl1_empty_referential_key_error(con, app):
|
|||
def test_create_rl1_already_linked_error(con, app):
|
||||
url = get_endpoint('create-rl1')
|
||||
params = {
|
||||
'categorie': 'ACCEUI',
|
||||
'category': 'ACCEUI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1438,7 +1438,7 @@ def test_create_rl1_wrong_referential_key_error(mocked_post, mocked_get, con, ap
|
|||
mocked_post.side_effect = [READ_CATEGORIES, READ_SITUATIONS, READ_CIVILITIES, READ_QUALITIES]
|
||||
url = get_endpoint('create-rl1')
|
||||
params = {
|
||||
'categorie': 'ACCEUI',
|
||||
'category': 'ACCEUI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
@ -1472,7 +1472,7 @@ def test_create_rl1_maelis_error(mocked_post, mocked_get, con, app):
|
|||
]
|
||||
url = get_endpoint('create-rl1')
|
||||
params = {
|
||||
'categorie': 'ACCEUI',
|
||||
'category': 'ACCEUI',
|
||||
'situation': 'C',
|
||||
'rl1/civility': 'M.',
|
||||
'rl1/firstname': 'Jhon',
|
||||
|
|
Loading…
Reference in New Issue