toulouse-maelis: do not warn about unknown axel indicator (#79338)
gitea/passerelle/pipeline/head This commit looks good Details

This commit is contained in:
Nicolas Roche 2023-07-03 17:47:34 +02:00 committed by Nicolas Roche
parent 25420ca260
commit 2b0612d5ef
3 changed files with 11 additions and 2 deletions

View File

@ -334,7 +334,8 @@ class ToulouseMaelis(BaseResource, HTTPResource):
try:
return self.referential.get(referential_name=referential_name, item_id=key).item_text
except Referential.DoesNotExist:
self.logger.warning("No '%s' key into Maelis '%s' referential", key, referential_name)
if key != 'NUMPERS_AXEL':
self.logger.warning("No '%s' key into Maelis '%s' referential", key, referential_name)
return key if default == 'key' else None
def get_link(self, NameID):

View File

@ -36,6 +36,11 @@
<profession>
<addressPro/>
</profession>
<indicatorList>
<code>NUMPERS_AXEL</code>
<libelle>Numéro de personne Axel</libelle>
<note>536417</note>
</indicatorList>
</RL1>
</familyResult>
</ns2:readFamilyResponse>

View File

@ -1190,7 +1190,7 @@ def test_read_rl_list(family_service, con, app):
]
def test_read_rl_list_no_rl2(family_service, con, app):
def test_read_rl_list_no_rl2(family_service, con, app, caplog):
family_service.add_soap_response('readFamily', get_xml_file('R_read_family_with_only_rl1.xml'))
url = get_endpoint('read-rl-list')
Link.objects.create(resource=con, family_id='1312', name_id='local')
@ -1199,6 +1199,9 @@ def test_read_rl_list_no_rl2(family_service, con, app):
assert resp.json['err'] == 0
assert [(x['id'], x['text']) for x in resp.json['data']] == [('613878', 'DOE JHON')]
# no warning about NUMPERS_AXEL indicator
assert all([x.levelno == logging.INFO for x in caplog.records])
def test_read_rl_list_not_linked_error(con, app):
url = get_endpoint('read-rl-list')