toulouse-maelis: [functests] re-enabling tests on ape (#77634)

This commit is contained in:
Nicolas Roche 2023-05-24 10:03:36 +02:00
parent 29f626492a
commit aaccbaf9ce
3 changed files with 67 additions and 52 deletions

View File

@ -5,14 +5,8 @@
"level": "INDI_APE_ENF",
"indicatorList": [
{
"code": "APE-MINE",
"libelle": "SP-parent mineur",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_ALLO",
"libelle": "SP-accompagnement enfant allophone",
"code": "APE_COMPO3",
"libelle": "CF-0/1 actif",
"typeDesc": "NONE",
"choiceList": []
},
@ -28,6 +22,12 @@
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_MULTIACC",
"libelle": "CF-2 enfants \u00e0 accueillir",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_SITUP",
"libelle": "SP-situation particuli\u00e8re personne",
@ -41,24 +41,12 @@
"text": "INDI_APE_FAM",
"level": "INDI_APE_FAM",
"indicatorList": [
{
"code": "APE_COMPO1",
"libelle": "CF-100% actif",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_COMPO2",
"libelle": "CF-1/2 actif",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_COMPO3",
"libelle": "CF-0/1 actif",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_COMPO4",
"libelle": "CF-0/2 actif",
@ -66,14 +54,45 @@
"choiceList": []
},
{
"code": "APE_NAIM",
"libelle": "CF-naissance multiple",
"code": "APE_FIRSTC",
"libelle": "CF-premier enfant",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_MULTIACC",
"libelle": "CF-2 enfants \u00e0 accueillir",
"code": "APE_HAND",
"libelle": "H-handicap ou maladie chronique",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_NAIM",
"libelle": "CF-naissance multiple",
"typeDesc": "NONE",
"choiceList": []
}
]
},
{
"id": "INDI_APE_RES",
"text": "INDI_APE_RES",
"level": "INDI_APE_RES",
"indicatorList": [
{
"code": "APE_COMPO1",
"libelle": "CF-100% actif",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_FRAT",
"libelle": "CF-Fratrie d\u00e9j\u00e0 en accueil",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_KOFRAT",
"libelle": "CF-sans proposition pour une partie de la fratrie",
"typeDesc": "NONE",
"choiceList": []
},
@ -88,35 +107,16 @@
"libelle": "SP-situation particuli\u00e8re logement",
"typeDesc": "NONE",
"choiceList": []
}
]
},
{
"id": "INDI_APE_RES",
"text": "INDI_APE_RES",
"level": "INDI_APE_RES",
"indicatorList": [
},
{
"code": "APE_FIRSTC",
"libelle": "CF-premier enfant",
"code": "APE_ALLO",
"libelle": "SP-accompagnement enfant allophone",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_FRAT",
"libelle": "CF-Fratrie d\u00e9j\u00e0 en accueil",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_HAND",
"libelle": "H-handicap ou maladie chronique",
"typeDesc": "NONE",
"choiceList": []
},
{
"code": "APE_KOFRAT",
"libelle": "CF-sans proposition pour une partie de la fratrie",
"code": "APE-MINE",
"libelle": "SP-parent mineur",
"typeDesc": "NONE",
"choiceList": []
}

View File

@ -195,6 +195,13 @@
"text": "Certificat de scolarit\u00e9",
"libelle": "Certificat de scolarit\u00e9"
},
{
"id": "93",
"code": "93",
"rang": "PERSON",
"text": "Certificat de travail",
"libelle": "Certificat de travail"
},
{
"id": "74",
"code": "74",

View File

@ -3,9 +3,13 @@ import datetime
import pytest
import requests
from .conftest import link, unlink
@pytest.mark.xfail(run=False)
def test_create_nursery_demand_on_existing_child(conn, create_data):
unlink(conn, create_data['name_id'])
link(conn, create_data)
url = conn + '/get-nursery-geojson'
resp = requests.get(url)
resp.raise_for_status()
@ -23,10 +27,10 @@ def test_create_nursery_demand_on_existing_child(conn, create_data):
url = conn + '/create-nursery-demand'
payload = {
'family_id': create_data['family_id'],
'family_indicators/0/code': 'APE_COMPO1',
'family_indicators/0/code': 'APE_FIRSTC',
'family_indicators/0/isActive': True,
'child_id': create_data['maggie_num'],
'demand_indicators/0/code': 'APE_FIRSTC',
'demand_indicators/0/code': 'APE_COMPO1',
'demand_indicators/0/isActive': True,
'start_date': datetime.date.today().strftime('%Y-%m-%d'),
'number_of_days': '2',
@ -57,8 +61,10 @@ def test_create_nursery_demand_on_existing_child(conn, create_data):
assert len(res['data']['childList']) == nb_childs
@pytest.mark.xfail(run=False)
def test_create_nursery_demand_adding_new_child(conn, create_data):
unlink(conn, create_data['name_id'])
link(conn, create_data)
url = conn + '/get-nursery-geojson'
resp = requests.get(url)
resp.raise_for_status()
@ -72,6 +78,7 @@ def test_create_nursery_demand_adding_new_child(conn, create_data):
res = resp.json()
assert res['err'] == 0
nb_childs = len(res['data']['childList'])
assert 'NELSON' not in [x['firstname'] for x in res['data']['childList']]
url = conn + '/create-nursery-demand'
payload = {
@ -104,4 +111,5 @@ def test_create_nursery_demand_adding_new_child(conn, create_data):
res = resp.json()
assert res['err'] == 0
assert len(res['data']['childList']) == nb_childs + 1
assert 'NELSON' in [x['firstname'] for x in res['data']['childList']]
assert res['data']['childList'][nb_childs]['num'] == child_id