hotfix/v7.15 #217

Closed
ecazenave wants to merge 2 commits from hotfix/v7.15 into main
3 changed files with 23 additions and 15 deletions

View File

@ -375,6 +375,7 @@ class APIEntreprise(BaseResource):
'v3/infogreffe/rcs/unites_legales/%s/mandataires_sociaux' % siren, raw=True, **kwargs
).get('data')
for mandataire in mandataires_data:
mandataire = mandataire.get('data', {})
for key in ('nom', 'prenom', 'fonction'):
if key not in mandataire:
mandataire[key] = ''
@ -465,6 +466,7 @@ class APIEntreprise(BaseResource):
if method not in methods:
return {'err': 1, 'err_desc': 'method %s not implemented' % method}
for mandataire in mandataires:
mandataire = mandataire.get('data', {})
if methods[method](mandataire, first_name, last_name, birthdate):
return {'err': 0, 'data': mandataire}
return {'err': 0, 'data': {}}

View File

@ -120,23 +120,27 @@ UNITES_LEGALES_SIEGE_RESPONSE = {
RCS_UNITES_LEGALES_MANDATAIRES_SOCIAUX_RESPONSE = {
"data": [
{
"nom": "HISQUIN",
"prenom": "FRANCOIS",
"fonction": "PRESIDENT DU DIRECTOIRE",
"dirigeant": True,
"date_naissance": "1965-01-27",
"raison_sociale": "",
"identifiant": "",
"type": "PP",
"data": {
"nom": "HISQUIN",
"prenom": "FRANCOIS",
"fonction": "PRESIDENT DU DIRECTOIRE",
"dirigeant": True,
"date_naissance": "1965-01-27",
"raison_sociale": "",
"identifiant": "",
"type": "PP",
},
},
{
"fonction": "COMMISSAIRE AUX COMPTES SUPPLEANT",
"dirigeant": True,
"date_naissance": "",
"date_naissance_timestamp": 0,
"raison_sociale": "BCRH & ASSOCIES - SOCIETE A RESPONSABILITE LIMITEE A ASSOCIE UNIQUE",
"identifiant": "490092574",
"type": "PM",
"data": {
"fonction": "COMMISSAIRE AUX COMPTES SUPPLEANT",
"dirigeant": True,
"date_naissance": "",
"date_naissance_timestamp": 0,
"raison_sociale": "BCRH & ASSOCIES - SOCIETE A RESPONSABILITE LIMITEE A ASSOCIE UNIQUE",
"identifiant": "490092574",
"type": "PM",
},
},
]
}

View File

@ -20,6 +20,7 @@ import pytest
import requests
@pytest.mark.skip(reason="instable")
def test_wcs_fixture(wcs_host):
assert wcs_host.url.startswith('http://127.0.0.1:')
requests.get(wcs_host.url)
@ -27,6 +28,7 @@ def test_wcs_fixture(wcs_host):
assert response.json()['data'][0]['title'] == 'Catégorie'
@pytest.mark.skip(reason="instable")
def test_wcs_api(wcs_host):
from passerelle.utils.wcs import WcsApiError