toulouse-foederis: add missing referentials (#76755)
gitea/passerelle/pipeline/head This commit looks good
Details
gitea/passerelle/pipeline/head This commit looks good
Details
This commit is contained in:
parent
8146b2f0c8
commit
b3dfbd17df
|
@ -48,7 +48,9 @@ class Resource(BaseResource, HTTPResource):
|
|||
|
||||
@property
|
||||
def referentiels_documents(self):
|
||||
return self.documents.filter(external_id__in=[document_id for document_id, _ in self.REFERENTIELS])
|
||||
return self.documents.filter(
|
||||
external_id__in=[document_id for document_id, _, __ in self.REFERENTIELS]
|
||||
)
|
||||
|
||||
@property
|
||||
def announces_documents(self):
|
||||
|
@ -75,7 +77,7 @@ class Resource(BaseResource, HTTPResource):
|
|||
raise requests.RequestException('code field is not 200, message=%s' % data.get('message'))
|
||||
return data.get('results', [])
|
||||
|
||||
def update_referentiel(self, document_id, path):
|
||||
def update_referentiel(self, document_id, path, parent):
|
||||
try:
|
||||
results = self.http_request('GET', f'data/{path}?viewIntegrationName=api_publik')
|
||||
except requests.RequestException:
|
||||
|
@ -83,7 +85,13 @@ class Resource(BaseResource, HTTPResource):
|
|||
|
||||
if not results:
|
||||
return
|
||||
data = [{'id': r['name'], 'text': r['name']} for r in results]
|
||||
|
||||
if parent is None:
|
||||
data = [{'id': r['id'], 'text': r['name']} for r in results]
|
||||
else:
|
||||
parent_fkey = self.REFERENTIELS_FKEYS[parent]
|
||||
data = [{'id': r['id'], 'text': r['name'], 'parents': r[parent_fkey]} for r in results]
|
||||
|
||||
self.documents.update_or_create(defaults={'data': data}, external_id=document_id)
|
||||
|
||||
ANNOUNCES_FIELDS = [
|
||||
|
@ -192,15 +200,36 @@ class Resource(BaseResource, HTTPResource):
|
|||
self.announces_documents.exclude(external_id__in=announces).delete()
|
||||
|
||||
REFERENTIELS = [
|
||||
# document_id, path
|
||||
('type_emploi', 'type_emploi'),
|
||||
('categorie', 'categorie1'),
|
||||
('filiere', 'Filiere'),
|
||||
# document_id, path, parent fkey
|
||||
('origine_candidature', 'origine_candidature', None),
|
||||
('civilite', 'civilite', None),
|
||||
('nationalite', 'nationalite1', None),
|
||||
('situation_actuelle', 'situation_actuelle', None),
|
||||
('type_emploi', 'type_emploi', None),
|
||||
('domaine_emploi', 'domaine_emploi', None),
|
||||
('sous_domaine_emploi', 'sous_domaine_emploi', 'domaine_emploi'),
|
||||
('emploi', 'emploi', 'sous_domaine_emploi'),
|
||||
('niveau_diplome', 'niveau_diplome1', None),
|
||||
('habilitation', 'habilitation', None),
|
||||
]
|
||||
|
||||
REFERENTIELS_FKEYS = {
|
||||
'origine_candidature': 'R1261279',
|
||||
'civilite': 'R60284409',
|
||||
'nationalite': 'R1249730',
|
||||
'situation_actuelle': 'R1258320',
|
||||
'annonce': 'R14848305',
|
||||
'type_emploi': 'R1249707',
|
||||
'domaine_emploi': 'R60845221',
|
||||
'sous_domaine_emploi': 'R60845244',
|
||||
'emploi': 'R15017962',
|
||||
'niveau_diplome': 'R1249737',
|
||||
'habilitation': 'R1276043',
|
||||
}
|
||||
|
||||
def update_referentiels(self):
|
||||
for document_id, path in self.REFERENTIELS:
|
||||
self.update_referentiel(document_id, path)
|
||||
for document_id, path, parent in self.REFERENTIELS:
|
||||
self.update_referentiel(document_id, path, parent)
|
||||
self.update_announces()
|
||||
|
||||
def hourly(self):
|
||||
|
@ -214,19 +243,20 @@ class Resource(BaseResource, HTTPResource):
|
|||
@endpoint(
|
||||
description=_('Get data source'),
|
||||
long_description=_('Available datasources: %s')
|
||||
% ', '.join(document_id.replace('_', '-') for document_id, dummy in REFERENTIELS),
|
||||
% ', '.join(document_id.replace('_', '-') for document_id, _, __ in REFERENTIELS),
|
||||
name='ds',
|
||||
pattern=r'^(?P<name>[a-z_-]+)/$',
|
||||
example_pattern='{name}/',
|
||||
perm='can_access',
|
||||
parameters={
|
||||
'name': {'description': _('Data source name'), 'example_value': 'type-emploi'},
|
||||
'name': {'description': _('Data source name'), 'example_value': 'domaine_emploi'},
|
||||
'parent': {'description': _('Parent data source id'), 'example_value': '5776388'},
|
||||
},
|
||||
json_schema_response=datasource_schema(),
|
||||
)
|
||||
def datasource(self, request, name):
|
||||
def datasource(self, request, name, parent=None):
|
||||
name = name.replace('-', '_')
|
||||
for document_id, dummy in self.REFERENTIELS:
|
||||
for document_id, _, __ in self.REFERENTIELS:
|
||||
if document_id == name:
|
||||
break
|
||||
else:
|
||||
|
@ -238,9 +268,14 @@ class Resource(BaseResource, HTTPResource):
|
|||
'data': [],
|
||||
'last_update': None,
|
||||
}
|
||||
|
||||
data = document.data
|
||||
if parent is not None:
|
||||
data = [item for item in data if int(parent) in item.get('parents', [])]
|
||||
|
||||
return {
|
||||
'err': 0,
|
||||
'data': document.data,
|
||||
'data': data,
|
||||
'last_update': localtime(document.updated).strftime('%F %T'),
|
||||
}
|
||||
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
{
|
||||
"code": 200,
|
||||
"message": "OK",
|
||||
"results": [
|
||||
{
|
||||
"name": "FILIERE ADMINISTRATIVE",
|
||||
"id": 170083
|
||||
},
|
||||
{
|
||||
"name": "FILIERE POLICE",
|
||||
"id": 170084
|
||||
},
|
||||
{
|
||||
"name": "FILIERE CULTURELLE",
|
||||
"id": 170085
|
||||
},
|
||||
{
|
||||
"name": "FILIERE ANIMATION",
|
||||
"id": 170087
|
||||
},
|
||||
{
|
||||
"name": "FILIERE SPORTIVE",
|
||||
"id": 170089
|
||||
},
|
||||
{
|
||||
"name": "FILIERE PRATICIEN HOSPITALIER",
|
||||
"id": 170090
|
||||
},
|
||||
{
|
||||
"name": "FILIERE MEDICO-SOCIALE",
|
||||
"id": 170091
|
||||
},
|
||||
{
|
||||
"name": "FILIERE MEDICO-TECHNIQUE",
|
||||
"id": 170092
|
||||
},
|
||||
{
|
||||
"name": "FILIERE SOCIALE",
|
||||
"id": 170093
|
||||
},
|
||||
{
|
||||
"name": "FILIERE TECHNIQUE",
|
||||
"id": 170094
|
||||
},
|
||||
{
|
||||
"name": "FILIERE SAPEURS POMPIERS",
|
||||
"id": 170095
|
||||
},
|
||||
{
|
||||
"name": "FILIERE NON DEFINIE",
|
||||
"id": 170096
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
{
|
||||
"code": 200,
|
||||
"message": "OK",
|
||||
"results": [
|
||||
{
|
||||
"name": "A-DIRECTION/CONCEPTION/ENCADT",
|
||||
"id": 170444
|
||||
},
|
||||
{
|
||||
"name": "B-CADRES MOYENS",
|
||||
"id": 170445
|
||||
},
|
||||
{
|
||||
"name": "C-AGENTS EXECUTION",
|
||||
"id": 170446
|
||||
},
|
||||
{
|
||||
"name": "D",
|
||||
"id": 170447
|
||||
},
|
||||
{
|
||||
"name": "E",
|
||||
"id": 170448
|
||||
},
|
||||
{
|
||||
"name": "X",
|
||||
"id": 1166037
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"code": 200,
|
||||
"message": "OK",
|
||||
"results": [
|
||||
{
|
||||
"name": "Mademoiselle",
|
||||
"id": 170015
|
||||
},
|
||||
{
|
||||
"name": "Monsieur",
|
||||
"id": 170013
|
||||
},
|
||||
{
|
||||
"name": "Madame",
|
||||
"id": 170014
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"code": 200,
|
||||
"message": "OK",
|
||||
"results": [
|
||||
{
|
||||
"name": "TEST SUP",
|
||||
"id": 6004442
|
||||
},
|
||||
{
|
||||
"name": "PPEM PILOTAGE MANAGEMENT ET GESTION DES RESSOURCES",
|
||||
"id": 5776388
|
||||
},
|
||||
{
|
||||
"name": "PPEM INTERVENTIONS TECHNIQUES",
|
||||
"id": 5776389
|
||||
},
|
||||
{
|
||||
"name": "PPEM ANIMATION ET SERVICES A LA POPULATION",
|
||||
"id": 5776390
|
||||
},
|
||||
{
|
||||
"name": "PPEM POLITIQUES PUBLIQUES D'AMENAGEMENT ET DE DEV. TERRIT.",
|
||||
"id": 5776391
|
||||
},
|
||||
{
|
||||
"name": "PPEM SECURITE",
|
||||
"id": 5776392
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,206 @@
|
|||
{
|
||||
"code": 200,
|
||||
"message": "OK",
|
||||
"results": [
|
||||
{
|
||||
"R15018016": [
|
||||
5776391
|
||||
],
|
||||
"name": "CHARGE OU CHARGEE DU DEVELOPPEMENT TERRITORIAL",
|
||||
"id": 291844,
|
||||
"R60845244": [
|
||||
5776416
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776391
|
||||
],
|
||||
"name": "CHEF OU CHEFFE DE PROJET ACTIONS EUROPEENNES ET INTERNATIONALES",
|
||||
"id": 291845,
|
||||
"R60845244": [
|
||||
5776416
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776391
|
||||
],
|
||||
"name": "DEVELOPPEUR OU DEVELOPPEUSE ECONOMIQUE",
|
||||
"id": 291846,
|
||||
"R60845244": [
|
||||
5776416
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776391
|
||||
],
|
||||
"name": "REFERENT OU REFERENTE DE QUARTIER",
|
||||
"id": 291847,
|
||||
"R60845244": [
|
||||
5776416
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776391
|
||||
],
|
||||
"name": "CHARGE OU CHARGEE D ANIMATION A L EDUCATION AU DEVELOPPEMENT DURABLE",
|
||||
"id": 291848,
|
||||
"R60845244": [
|
||||
5776417
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776391
|
||||
],
|
||||
"name": "CHEF OU CHEFFE DE PROJET RIVIERES ET MILIEUX AQUATIQUES",
|
||||
"id": 291849,
|
||||
"R60845244": [
|
||||
5776417
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776391
|
||||
],
|
||||
"name": "AGENT RECENSEUR OU AGENTE RECENSEUSE LOGEMENT ACCESSIBLE",
|
||||
"id": 291850,
|
||||
"R60845244": [
|
||||
5776418
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776391
|
||||
],
|
||||
"name": "CHARGE OU CHARGEE PLANIFICATION PROGRAMMATION",
|
||||
"id": 291851,
|
||||
"R60845244": [
|
||||
5776419
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776391
|
||||
],
|
||||
"name": "INSTRUCTEUR OU INSTRUCTRICE DES AUTORISATIONS D'URBANISME, ENSEIGNES ET TLPE",
|
||||
"id": 291852,
|
||||
"R60845244": [
|
||||
5776419
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776391
|
||||
],
|
||||
"name": "CHARGE OU CHARGEE D ANIMATION PLUI-H ET RLPI",
|
||||
"id": 291853,
|
||||
"R60845244": [
|
||||
5776419
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776390
|
||||
],
|
||||
"name": "CHARGE OU CHARGEE DE PRODUCTION",
|
||||
"id": 291854,
|
||||
"R60845244": [
|
||||
5776408
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776390
|
||||
],
|
||||
"name": "COSTUMIER OU COSTUMIERE",
|
||||
"id": 291855,
|
||||
"R60845244": [
|
||||
5776408
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776390
|
||||
],
|
||||
"name": "DANSEUR OU DANSEUSE",
|
||||
"id": 291856,
|
||||
"R60845244": [
|
||||
5776408
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776390
|
||||
],
|
||||
"name": "HABILLEUR OU HABILLEUSE",
|
||||
"id": 291857,
|
||||
"R60845244": [
|
||||
5776408
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776390
|
||||
],
|
||||
"name": "MAQUILLEUR COIFFEUR OU MAQUILLEUSE COIFFEUSE/ PERRUQUIER OU PERRUQUIERE",
|
||||
"id": 291858,
|
||||
"R60845244": [
|
||||
5776408
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776390
|
||||
],
|
||||
"name": "MUSICIEN OU MUSICIENNE-ARTISTE DU CHOEUR",
|
||||
"id": 291859,
|
||||
"R60845244": [
|
||||
5776408
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776390
|
||||
],
|
||||
"name": "DECORATEUR OU DECORATRICE",
|
||||
"id": 291860,
|
||||
"R60845244": [
|
||||
5776408
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776390
|
||||
],
|
||||
"name": "MACHINISTE",
|
||||
"id": 291861,
|
||||
"R60845244": [
|
||||
5776408
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776390
|
||||
],
|
||||
"name": "PUPITREUR OU PUPITREUSE",
|
||||
"id": 291862,
|
||||
"R60845244": [
|
||||
5776408
|
||||
]
|
||||
},
|
||||
{
|
||||
"R15018016": [
|
||||
5776390
|
||||
],
|
||||
"name": "REGISSEUR OU REGISSEUSE LUMIERE ET/OU AUDIOVISUEL",
|
||||
"id": 291863,
|
||||
"R60845244": [
|
||||
5776408
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"code": 200,
|
||||
"message": "OK",
|
||||
"results": [
|
||||
{
|
||||
"name": "R.482 - A - CACES engins de chantier",
|
||||
"id": 1525043,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.482 - B1 - CACES engins de chantier",
|
||||
"id": 1525044,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.482 - B2 - CACES engins de chantier",
|
||||
"id": 1525045,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.482 - B3 - CACES engins de chantier",
|
||||
"id": 1525046,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.482 - C1 - CACES engins de chantier",
|
||||
"id": 1525047,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.482 - C2 - CACES engins de chantier",
|
||||
"id": 1525048,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.482 - C3 - CACES engins de chantier",
|
||||
"id": 1525049,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.482 - D - CACES engins de chantier",
|
||||
"id": 1525050,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.482 - E - CACES engins de chantier",
|
||||
"id": 1525051,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.482 - F - CACES engins de chantier",
|
||||
"id": 1525052,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.482 - G - CACES engins de chantier",
|
||||
"id": 1525053,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.483 - A - CACES grues mobiles",
|
||||
"id": 1525054,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.483 - B - CACES grues mobiles",
|
||||
"id": 1525055,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.484 - 1 - CACES Ponts roulants et portiques",
|
||||
"id": 1525056,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.484 - 2 - CACES Ponts roulants et portiques",
|
||||
"id": 1525057,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.485 - 1 - CACES chariots de manutention automoteurs gerberus à conducteur accompagnant",
|
||||
"id": 1525058,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R.485 - 2 - CACES chariots de manutention automoteurs gerberus à conducteur accompagnant",
|
||||
"id": 1525059,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R,486 - A - CACES Plate-formes élévatrices mobiles de personnel",
|
||||
"id": 1525060,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R,486 - B - CACES Plate-formes élévatrices mobiles de personnel",
|
||||
"id": 1525061,
|
||||
"est_caces": "O"
|
||||
},
|
||||
{
|
||||
"name": "R,486 - C - CACES Plate-formes élévatrices mobiles de personnel",
|
||||
"id": 1525062,
|
||||
"est_caces": "O"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
{
|
||||
"code": 200,
|
||||
"message": "OK",
|
||||
"results": [
|
||||
{
|
||||
"name": "Saint-Marinaise",
|
||||
"id": 93405
|
||||
},
|
||||
{
|
||||
"name": "Uruguayenne",
|
||||
"id": 93406
|
||||
},
|
||||
{
|
||||
"name": "Samoane",
|
||||
"id": 93407
|
||||
},
|
||||
{
|
||||
"name": "Americaine",
|
||||
"id": 93408
|
||||
},
|
||||
{
|
||||
"name": "Ougandaise",
|
||||
"id": 93409
|
||||
},
|
||||
{
|
||||
"name": "Saint-Vincentaise-et-Grenadine",
|
||||
"id": 93410
|
||||
},
|
||||
{
|
||||
"name": "Saint-Lucienne",
|
||||
"id": 93411
|
||||
},
|
||||
{
|
||||
"name": "Taiwanaise",
|
||||
"id": 93412
|
||||
},
|
||||
{
|
||||
"name": "Kittitienne-et-nevicienne",
|
||||
"id": 93413
|
||||
},
|
||||
{
|
||||
"name": "Trinidadienne",
|
||||
"id": 93414
|
||||
},
|
||||
{
|
||||
"name": "Saint-Pierrais or Miquelonnais",
|
||||
"id": 93415
|
||||
},
|
||||
{
|
||||
"name": "Ukrainienne",
|
||||
"id": 93416
|
||||
},
|
||||
{
|
||||
"name": "Saint-Martinoise",
|
||||
"id": 93417
|
||||
},
|
||||
{
|
||||
"name": "Tanzanienne",
|
||||
"id": 93418
|
||||
},
|
||||
{
|
||||
"name": "Rwandaise",
|
||||
"id": 93419
|
||||
},
|
||||
{
|
||||
"name": "Thaïlandaise",
|
||||
"id": 93420
|
||||
},
|
||||
{
|
||||
"name": "Réunionese, Réunionnais",
|
||||
"id": 93421
|
||||
},
|
||||
{
|
||||
"name": "Salvadorienne",
|
||||
"id": 93422
|
||||
},
|
||||
{
|
||||
"name": "Saint Helenian",
|
||||
"id": 93423
|
||||
},
|
||||
{
|
||||
"name": "Turque",
|
||||
"id": 93424
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"code": 200,
|
||||
"message": "OK",
|
||||
"results": [
|
||||
{
|
||||
"name": "Niveau 3 - CAP, BEP",
|
||||
"id": 1124017
|
||||
},
|
||||
{
|
||||
"name": "Niveau 4 - Baccalauréat",
|
||||
"id": 1124018
|
||||
},
|
||||
{
|
||||
"name": "Niveau 5 - DEUG, BTS, DUT, DEUST",
|
||||
"id": 1124019
|
||||
},
|
||||
{
|
||||
"name": "Niveau 6 - Maîtrise, Licence, Licence LMD, licence professionnelle",
|
||||
"id": 1124020
|
||||
},
|
||||
{
|
||||
"name": "Niveau 7 - Master, DEA, DESS, diplôme d'ingénieur",
|
||||
"id": 1124022
|
||||
},
|
||||
{
|
||||
"name": "Niveau 8 - Doctorat, habilitation à diriger des recherches",
|
||||
"id": 1124023
|
||||
},
|
||||
{
|
||||
"name": "Niveau 2 - Pas de diplôme",
|
||||
"id": 1133053
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
"code": 200,
|
||||
"message": "OK",
|
||||
"results": [
|
||||
{
|
||||
"name": "Site de la collectivité",
|
||||
"id": 1261278
|
||||
},
|
||||
{
|
||||
"name": "Autre, précisez",
|
||||
"id": 1294070
|
||||
},
|
||||
{
|
||||
"name": "Emploi Collectivités",
|
||||
"id": 1561049
|
||||
},
|
||||
{
|
||||
"name": "La Gazette emploi / Territoriale / Lettre du cadre",
|
||||
"id": 1561050
|
||||
},
|
||||
{
|
||||
"name": "Le moniteur / Technicités / L'usine digitale",
|
||||
"id": 1561051
|
||||
},
|
||||
{
|
||||
"name": "Site de l'emploi territorial",
|
||||
"id": 1561052
|
||||
},
|
||||
{
|
||||
"name": "Emploi Public",
|
||||
"id": 1561053
|
||||
},
|
||||
{
|
||||
"name": "LinkedIn",
|
||||
"id": 1561054
|
||||
},
|
||||
{
|
||||
"name": "APEC",
|
||||
"id": 1561055
|
||||
},
|
||||
{
|
||||
"name": "Pôle Emploi",
|
||||
"id": 1561056
|
||||
},
|
||||
{
|
||||
"name": "ProfilCulture",
|
||||
"id": 1561057
|
||||
},
|
||||
{
|
||||
"name": "Emploi Environnement",
|
||||
"id": 1561058
|
||||
},
|
||||
{
|
||||
"name": "Lelienhorticole",
|
||||
"id": 1561059
|
||||
},
|
||||
{
|
||||
"name": "Emploi-paysagiste.fr",
|
||||
"id": 1561060
|
||||
},
|
||||
{
|
||||
"name": "Projeteurs.com",
|
||||
"id": 1561061
|
||||
},
|
||||
{
|
||||
"name": "Fédération Nationale des Agences d'Urbanisme",
|
||||
"id": 1561062
|
||||
},
|
||||
{
|
||||
"name": "Forum",
|
||||
"id": 1561063
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"code": 200,
|
||||
"message": "OK",
|
||||
"results": [
|
||||
{
|
||||
"name": "Demandeur d'emploi",
|
||||
"id": 1561070
|
||||
},
|
||||
{
|
||||
"name": "Contrat aidé",
|
||||
"id": 1561069
|
||||
},
|
||||
{
|
||||
"name": "Etudiant",
|
||||
"id": 1561068
|
||||
},
|
||||
{
|
||||
"name": "Inactif",
|
||||
"id": 1561071
|
||||
},
|
||||
{
|
||||
"name": "Salarié du privé",
|
||||
"id": 1561067
|
||||
},
|
||||
{
|
||||
"name": "Contractuel Fonction Publique",
|
||||
"id": 1561066
|
||||
},
|
||||
{
|
||||
"name": "Fonctionnaire FPE",
|
||||
"id": 1561065
|
||||
},
|
||||
{
|
||||
"name": "Fonctionnaire FPH",
|
||||
"id": 1561064
|
||||
},
|
||||
{
|
||||
"name": "Fonctionnaire FPT",
|
||||
"id": 1258319
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,146 @@
|
|||
{
|
||||
"code": 200,
|
||||
"message": "OK",
|
||||
"results": [
|
||||
{
|
||||
"name": "FINANCES",
|
||||
"id": 5776394,
|
||||
"R60845221": [
|
||||
5776388
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RESSOURCES HUMAINES",
|
||||
"id": 5776395,
|
||||
"R60845221": [
|
||||
5776388
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "AFFAIRES JURIDIQUES ET COMMANDE PUBLIQUE",
|
||||
"id": 5776396,
|
||||
"R60845221": [
|
||||
5776388
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "COMMUNICATION",
|
||||
"id": 5776397,
|
||||
"R60845221": [
|
||||
5776388
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "MANAGEMENT ET PILOTAGE DE PROJET",
|
||||
"id": 5776398,
|
||||
"R60845221": [
|
||||
5776388
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "SUPPORT ADMINISTRATIF",
|
||||
"id": 5776399,
|
||||
"R60845221": [
|
||||
5776388
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "SYSTEME D'INFORMATION ET T.I.C",
|
||||
"id": 5776400,
|
||||
"R60845221": [
|
||||
5776388
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ETUDES ET ANALYSES",
|
||||
"id": 5776401,
|
||||
"R60845221": [
|
||||
5776388
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "PROPRETE ET DECHETS",
|
||||
"id": 5776402,
|
||||
"R60845221": [
|
||||
5776389
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "IMMOBILIER ET BATIMENTS",
|
||||
"id": 5776403,
|
||||
"R60845221": [
|
||||
5776389
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "INFRASTRUCTURES",
|
||||
"id": 5776404,
|
||||
"R60845221": [
|
||||
5776389
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ESPACES VERTS ET PAYSAGES",
|
||||
"id": 5776405,
|
||||
"R60845221": [
|
||||
5776389
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "SUPPORT LOGISTIQUE TECHNIQUE ET MAINTENANCE",
|
||||
"id": 5776406,
|
||||
"R60845221": [
|
||||
5776389
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "EAU ET ASSAINISSEMENT",
|
||||
"id": 5776407,
|
||||
"R60845221": [
|
||||
5776389
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ARTS ET TECHNIQUES DU SPECTACLE",
|
||||
"id": 5776408,
|
||||
"R60845221": [
|
||||
5776390
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "BIBLIOTHEQUES ET CENTRES DOCUMENTAIRES",
|
||||
"id": 5776409,
|
||||
"R60845221": [
|
||||
5776390
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ENFANCE/ JEUNESSE/ SPORTS ET ANIMATION",
|
||||
"id": 5776410,
|
||||
"R60845221": [
|
||||
5776390
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "POPULATION ET FUNERAIRE",
|
||||
"id": 5776411,
|
||||
"R60845221": [
|
||||
5776390
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RESTAURATION COLLECTIVE",
|
||||
"id": 5776412,
|
||||
"R60845221": [
|
||||
5776390
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "SANTE",
|
||||
"id": 5776413,
|
||||
"R60845221": [
|
||||
5776390
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -40,15 +40,50 @@ HTTP_MOCKS = {
|
|||
'query': 'viewIntegrationName=api_publik',
|
||||
'content': get_json_content('type_emploi'),
|
||||
},
|
||||
'categorie': {
|
||||
'path': r'^/.*/data/categorie1$',
|
||||
'origine-candidature': {
|
||||
'path': r'^/.*/data/origine_candidature$',
|
||||
'query': 'viewIntegrationName=api_publik',
|
||||
'content': get_json_content('categorie1'),
|
||||
'content': get_json_content('origine_candidature'),
|
||||
},
|
||||
'filiere': {
|
||||
'path': r'^.*/data/Filiere$',
|
||||
'civilite': {
|
||||
'path': r'^/.*/data/civilite$',
|
||||
'query': 'viewIntegrationName=api_publik',
|
||||
'content': get_json_content('Filiere'),
|
||||
'content': get_json_content('civilite'),
|
||||
},
|
||||
'nationalite': {
|
||||
'path': r'^/.*/data/nationalite1$',
|
||||
'query': 'viewIntegrationName=api_publik',
|
||||
'content': get_json_content('nationalite1'),
|
||||
},
|
||||
'situation-actuelle': {
|
||||
'path': r'^/.*/data/situation_actuelle$',
|
||||
'query': 'viewIntegrationName=api_publik',
|
||||
'content': get_json_content('situation_actuelle'),
|
||||
},
|
||||
'domaine-emploi': {
|
||||
'path': r'^/.*/data/domaine_emploi$',
|
||||
'query': 'viewIntegrationName=api_publik',
|
||||
'content': get_json_content('domaine_emploi'),
|
||||
},
|
||||
'sous-domaine-emploi': {
|
||||
'path': r'^/.*/data/sous_domaine_emploi$',
|
||||
'query': 'viewIntegrationName=api_publik',
|
||||
'content': get_json_content('sous_domaine_emploi'),
|
||||
},
|
||||
'emploi': {
|
||||
'path': r'^/.*/data/emploi$',
|
||||
'query': 'viewIntegrationName=api_publik',
|
||||
'content': get_json_content('emploi'),
|
||||
},
|
||||
'niveau-diplome': {
|
||||
'path': r'^/.*/data/niveau_diplome1$',
|
||||
'query': 'viewIntegrationName=api_publik',
|
||||
'content': get_json_content('niveau_diplome1'),
|
||||
},
|
||||
'habilitation': {
|
||||
'path': r'^.*/data/habilitation$',
|
||||
'query': 'viewIntegrationName=api_publik',
|
||||
'content': get_json_content('habilitation'),
|
||||
},
|
||||
'annonce': {
|
||||
'path': r'^.*/data/annonce$',
|
||||
|
@ -208,19 +243,41 @@ class TestEndpoints:
|
|||
return freezer
|
||||
|
||||
def test_data_sources(self, app):
|
||||
for name in ['type-emploi', 'categorie', 'filiere']:
|
||||
for name in [
|
||||
'origine-candidature',
|
||||
'civilite',
|
||||
'nationalite',
|
||||
'situation-actuelle',
|
||||
'type-emploi',
|
||||
'domaine-emploi',
|
||||
'sous-domaine-emploi',
|
||||
'emploi',
|
||||
'niveau-diplome',
|
||||
'habilitation',
|
||||
]:
|
||||
response = app.get(f'/toulouse-foederis/foederis/ds/{name}/')
|
||||
assert response.json['err'] == 0
|
||||
assert response.json['last_update']
|
||||
assert {d['id'] for d in response.json['data']} == {
|
||||
assert {d['text'] for d in response.json['data']} == {
|
||||
d['name'] for d in HTTP_MOCKS[name]['content']['results']
|
||||
}
|
||||
|
||||
def test_data_source_with_parent(self, app):
|
||||
response = app.get('/toulouse-foederis/foederis/ds/emploi/?parent=5776416')
|
||||
assert response.json['err'] == 0
|
||||
assert response.json['last_update']
|
||||
assert {d['text'] for d in response.json['data']} == {
|
||||
'CHARGE OU CHARGEE DU DEVELOPPEMENT TERRITORIAL',
|
||||
'DEVELOPPEUR OU DEVELOPPEUSE ECONOMIQUE',
|
||||
'REFERENT OU REFERENTE DE QUARTIER',
|
||||
'CHEF OU CHEFFE DE PROJET ACTIONS EUROPEENNES ET INTERNATIONALES',
|
||||
}
|
||||
|
||||
def test_announce(self, app):
|
||||
response = app.get('/toulouse-foederis/foederis/announce/')
|
||||
content = response.json
|
||||
assert content['err'] == 0
|
||||
assert len(content['data_sources']) == 3
|
||||
assert len(content['data_sources']) == 10
|
||||
data = content['data']
|
||||
assert len(data) == 5
|
||||
|
||||
|
|
Loading…
Reference in New Issue