toulouse-maelis: [funtests] remettre en place les tests sur les inscriptions (#77634) #254

Merged
nroche merged 19 commits from wip/77634-functests-for-second-sprint into main 2023-06-23 15:41:52 +02:00
28 changed files with 1884 additions and 310 deletions

View File

@ -21,7 +21,7 @@ FAMILY_PAYLOAD = {
'rl1': {
'civility': 'MME',
'firstname': 'Marge',
'lastname': 'Simpson',
'lastname': 'Test_Simpson',
'maidenName': 'Bouvier',
'quality': 'MERE',
'birth': {
@ -32,14 +32,14 @@ FAMILY_PAYLOAD = {
'idStreet': '2317',
'num': '4',
'street1': 'requeried having idStreet provided',
'town': 'Springfield',
'zipcode': '62701',
'town': 'Toulouse',
'zipcode': '31400',
},
},
'rl2': {
'civility': 'MR',
'firstname': 'Homer',
'lastname': 'Simpson',
'lastname': 'Test_Simpson',
'quality': 'PERE',
'birth': {
'dateBirth': '1956-05-12',
@ -96,7 +96,7 @@ FAMILY_PAYLOAD = {
{
'sexe': 'M',
'firstname': 'Bart',
'lastname': 'Simpson',
'lastname': 'Test_Simpson',
'birth': {
'dateBirth': '2014-04-01',
'place': 'Brive-la-Gaillarde',
@ -158,7 +158,7 @@ FAMILY_PAYLOAD = {
'personInfo': {
'civility': 'MR',
'firstname': 'Abraham Jebediah',
'lastname': 'Simpson',
'lastname': 'Test_Simpson',
'dateBirth': '1927-05-24',
'sexe': 'M',
'contact': {
@ -175,7 +175,7 @@ FAMILY_PAYLOAD = {
'personInfo': {
'civility': 'MME',
'firstname': 'Mona Penelope',
'lastname': 'Simpson',
'lastname': 'Test_Simpson',
'dateBirth': '1929-03-15',
'sexe': 'F',
'contact': {
@ -193,7 +193,7 @@ FAMILY_PAYLOAD = {
{
'sexe': 'F',
'firstname': 'Lisa',
'lastname': 'Simpson',
'lastname': 'Test_Simpson',
'birth': {'dateBirth': '2016-05-09'},
'dietcode': 'MENU_SV',
'paiInfoBean': {
@ -203,7 +203,7 @@ FAMILY_PAYLOAD = {
{
'sexe': 'F',
'firstname': 'Maggie',
'lastname': 'Simpson',
'lastname': 'Test_Simpson',
'birth': {'dateBirth': '2018-12-17'},
'dietcode': 'MENU_PAI',
'paiInfoBean': {
@ -213,7 +213,7 @@ FAMILY_PAYLOAD = {
{
'sexe': 'M',
'firstname': 'Hugo',
'lastname': 'Simpson',
'lastname': 'Test_Simpson',
'birth': {'dateBirth': '2018-04-01'},
'dietcode': 'MENU_AV',
'paiInfoBean': {
@ -261,7 +261,10 @@ def pytest_addoption(parser):
parser.addoption('--nameid', help='Publik Name ID', default='functest')
parser.addoption('--dui', help='DUI number', default='')
parser.addoption(
'--lastname', help='override lastname to create a new "update" family', default='Simpson'
'--lastname', help='override lastname to create a new "update" family', default='Test_Simpson'
)
parser.addoption(
'--quick', action='store_true', help='do not reload referentials to speed-up tests', default=False
)
@ -403,7 +406,10 @@ def conn(request):
@pytest.fixture(scope='session')
def referentials(conn):
def referentials(request, conn):
quick = request.config.getoption('--quick')
if quick:
return
url = urlparse.urlparse(conn)
slug = url.path.split('/')[2]
cmd = (
@ -416,10 +422,10 @@ def referentials(conn):
@pytest.fixture(scope='session')
def create_data(request, conn):
def create_data(request, conn, reference_year):
name_id = request.config.getoption('--nameid')
unlink(conn, name_id)
lastname = 'EO_' + uuid4().hex[0:27]
lastname = 'TEST_' + uuid4().hex[0:25]
# create family
create_family_payload = copy.deepcopy(FAMILY_PAYLOAD)
@ -443,6 +449,21 @@ def create_data(request, conn):
resp.raise_for_status()
create_result = resp.json()
assert create_result['err'] == 0
# add requiered quotient for subscriptions
data = read_family(conn, name_id)
url = conn + '/update-quotient?NameID=%s&rl_id=%s' % (name_id, data['RL1']['num'])
payload = {
'yearRev': str(reference_year),
'dateStart': '%s-09-01' % (reference_year),
'dateEnd': '3000-08-31',
'mtt': '5000.0',
'cdquo': '1',
}
resp = requests.post(url, json=payload)
resp.raise_for_status()
assert resp.json()['err'] == 0
print('\ncreate DUI: %s' % str(create_result['data']['number']))
data = diff_family(conn, name_id, 'test_create_family.json')
@ -459,6 +480,58 @@ def create_data(request, conn):
}
@pytest.fixture(scope='session')
def create_data2(request, conn, reference_year):
name_id = request.config.getoption('--nameid')
unlink(conn, name_id)
lastname = 'TEST_' + uuid4().hex[0:25]
# create family that is not located into Toulouse
create_family_payload = copy.deepcopy(FAMILY_PAYLOAD)
create_family_payload['rl1']['lastname'] = lastname
create_family_payload['rl1']['adresse'] = create_family_payload['rl2']['adresse']
create_family_payload['rl2']['adresse'] = copy.deepcopy(FAMILY_PAYLOAD['rl1']['adresse'])
for child in create_family_payload['childList']:
child['lastname'] = lastname
url = conn + '/create-family?NameID=%s' % name_id
resp = requests.post(url, json=create_family_payload)
resp.raise_for_status()
create_result = resp.json()
assert create_result['err'] == 0
# add requiered quotient for subscriptions
data = read_family(conn, name_id)
url = conn + '/update-quotient?NameID=%s&rl_id=%s' % (name_id, data['RL1']['num'])
payload = {
'yearRev': str(reference_year),
'dateStart': '2023-05-15',
'dateEnd': '3000-12-31',
'mtt': '5000.0',
'cdquo': '1',
}
resp = requests.post(url, json=payload)
resp.raise_for_status()
assert resp.json()['err'] == 0
print('\ncreate DUI again: %s' % str(create_result['data']['number']))
data = diff_family(conn, name_id, 'test_create_family_out_town.json')
return {
'name_id': name_id, # linked
'family_id': str(create_result['data']['number']),
'family_payload': create_family_payload,
'lastname': lastname,
'rl1_num': data['RL1']['num'],
'rl2_num': data['RL2']['num'],
'bart_num': data['childList'][0]['num'],
'lisa_num': data['childList'][1]['num'],
'maggie_num': data['childList'][2]['num'],
'hugo_num': data['childList'][3]['num'],
'data': data,
}
@pytest.fixture(scope='session')
def update_data(request, conn):
name_id = request.config.getoption('--nameid')
@ -617,40 +690,102 @@ def get_subscription_info(nature, activity_text, unit_text, place_text, con, nam
}
@pytest.fixture(scope='session')
def loisirs_subscribe_info(conn, create_data, reference_year):
unlink(conn, create_data['name_id'])
link(conn, create_data)
def get_loisirs_subscribe_info(con, data, year):
return get_subscription_info(
'LOISIRS',
# Sigec made this loisirs activity available for functests
'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES',
'MERCREDI - 15h30/17h - 8/15Ans',
'ARGOULETS',
conn,
create_data['name_id'],
create_data['bart_num'],
reference_year,
con,
data['name_id'],
data['bart_num'],
year,
)
def get_loisirs_subscribe_info3(con, data, year):
return get_subscription_info(
'LOISIRS',
# Sigec made this loisirs activity available for functests
'Vitrail Fusing 1/2 Je Adultes',
'Inscription annuelle',
'Centre Culturel ALBAN MINVILLE',
con,
data['name_id'],
data['bart_num'],
year,
)
def get_extrasco_subscribe_info(con, data, year):
return get_subscription_info(
'EXTRASCO',
# Sigec made this extra-sco activity available for functests
'ADL ELEMENTAIRE Maourine Juin',
'PUBLIK ADL ELEMENTAIRE Maourine JUIN 22/23(NE PAS UTILISER)',
'MAOURINE (la) ELEMENTAIRE',
con,
data['name_id'],
data['bart_num'],
year,
)
def get_extrasco_subscribe_info2(con, data, year):
return get_subscription_info(
'EXTRASCO',
# Sigec made this extra-sco activity available for functests
'ADL MATERNELLE Lardenne Juin',
'PUBLIK ADL MATER JOURNEE AVEC REPAS',
'LARDENNE MATERNELLE',
con,
data['name_id'],
data['bart_num'],
year,
)
@pytest.fixture(scope='session')
def loisirs_subscribe_info(conn, create_data, reference_year):
unlink(conn, create_data['name_id'])
link(conn, create_data)
return get_loisirs_subscribe_info(conn, create_data, reference_year)
@pytest.fixture(scope='session')
def loisirs_subscribe_info2(conn, create_data2, reference_year):
unlink(conn, create_data2['name_id'])
link(conn, create_data2)
return get_loisirs_subscribe_info(conn, create_data2, reference_year)
@pytest.fixture(scope='session')
def loisirs_subscribe_info3(conn, create_data2, reference_year):
unlink(conn, create_data2['name_id'])
link(conn, create_data2)
return get_loisirs_subscribe_info3(conn, create_data2, reference_year)
@pytest.fixture(scope='session')
def extrasco_subscribe_info(conn, create_data, reference_year):
unlink(conn, create_data['name_id'])
link(conn, create_data)
return get_extrasco_subscribe_info(conn, create_data, reference_year)
return get_subscription_info(
'EXTRASCO',
# Sigec made this extra-sco activity available for functests
'ADL ELEMENTAIRE Maourine Avril 2023',
'ADL ELEMENTAIRE Maourine Avril 2023',
'MAOURINE (la) ELEMENTAIRE',
conn,
create_data['name_id'],
create_data['bart_num'],
reference_year,
)
@pytest.fixture(scope='session')
def extrasco_subscribe_info2(conn, create_data, reference_year):
unlink(conn, create_data['name_id'])
link(conn, create_data)
return get_extrasco_subscribe_info2(conn, create_data, reference_year)
@pytest.fixture(scope='session')
def extrasco_subscribe_info3(conn, create_data2, reference_year):
unlink(conn, create_data2['name_id'])
link(conn, create_data2)
return get_extrasco_subscribe_info2(conn, create_data2, reference_year)
@pytest.fixture(scope='session')
@ -664,11 +799,32 @@ def perisco_subscribe_info(conn, create_data, reference_year):
return get_subscription_info(
None,
# Sigec made this peri-sco activity available for functests
'TEMPS DU MIDI',
'Temps du midi',
'TEST TEMPS DU MIDI 22/23',
'DOLTO FRANCOISE MATERNELLE',
'AMIDONNIERS ELEMENTAIRE',
conn,
create_data['name_id'],
create_data['bart_num'],
reference_year,
)
@pytest.fixture(scope='session')
def perisco_subscribe_adulte_info(conn, create_data2, reference_year):
'''This fixture is a configuration trick from Sigec
as peri-sco should not be available for subscription
and as a consequence, should not be displayed from catalogs'''
unlink(conn, create_data2['name_id'])
link(conn, create_data2)
return get_subscription_info(
None,
# Sigec made this peri-sco activity available for functests
'RESTAURATION ADULTE',
'TEST RESTAURATION ADULTE 22/23',
'DOLTO FRANCOISE MATERNELLE',
conn,
create_data2['name_id'],
create_data2['bart_num'],
reference_year,
)

View File

@ -27,8 +27,8 @@
"numComp": null,
"street1": "RUE ACHILLE VIADIEU",
"street2": null,
"town": "Springfield",
"zipcode": "62701",
"town": "Toulouse",
"zipcode": "31400",
"idStreet_text": "RUE ACHILLE VIADIEU"
},
"contact": {
@ -42,7 +42,17 @@
"profession": null,
"CAFInfo": null,
"indicatorList": [],
"quotientList": [],
"quotientList": [
{
"yearRev": 2022,
"dateStart": "2022-09-01T00:00:00+02:00",
"dateEnd": "3000-08-31T00:00:00+02:00",
"mtt": 5000.0,
"cdquo": "1",
"codeUti": null,
"cdquo_text": "Revenus fiscaux"
}
],
"subscribeActivityList": [],
"civility_text": "MADAME",
"quality_text": "M\u00e8re"
@ -62,7 +72,8 @@
"countryCode": null,
"cdDepartment": "19",
"communeCode_text": "BRIVE-LA-GAILLARDE",
"cdDepartment_text": "CORREZE"
"cdDepartment_text": "CORREZE",
"zipCode": "19100"
},
"dietcode": "MENU_AV",
"bPhoto": true,
@ -71,7 +82,7 @@
{
"personInfo": {
"num": "N/A",
"lastname": "SIMPSON",
"lastname": "TEST_SIMPSON",
"firstname": "ABRAHAM JEBEDIAH",
"dateBirth": "1927-05-24T00:00:00+01:00",
"civility": "MR",
@ -93,7 +104,7 @@
{
"personInfo": {
"num": "N/A",
"lastname": "SIMPSON",
"lastname": "TEST_SIMPSON",
"firstname": "MONA PENELOPE",
"dateBirth": "1929-03-15T00:00:00Z",
"civility": "MME",

View File

@ -0,0 +1,408 @@
{
"number": "N/A",
"category": "BI",
"situation": "MARI",
"flagCom": false,
"nbChild": 3,
"nbTotalChild": 4,
"nbAES": "1",
"RL1": {
"num": "N/A",
"firstname": "MARGE",
"lastname": "N/A",
"maidenName": "BOUVIER",
"quality": "MERE",
"civility": "MME",
"birth": {
"dateBirth": "1950-10-01T00:00:00+01:00",
"place": null,
"communeCode": null,
"countryCode": "404",
"cdDepartment": null,
"countryCode_text": "USA"
},
"adresse": {
"idStreet": null,
"num": 742,
"numComp": null,
"street1": "Evergreen Terrace",
"street2": null,
"town": "Springfield",
"zipcode": "90701"
},
"contact": {
"phone": null,
"mobile": null,
"mail": null,
"isContactMail": false,
"isContactSms": false,
"isInvoicePdf": false
},
"profession": null,
"CAFInfo": null,
"indicatorList": [],
"quotientList": [
{
"yearRev": 2022,
"dateStart": "2023-05-15T00:00:00+02:00",
"dateEnd": "3000-12-31T00:00:00+01:00",
"mtt": 5000.0,
"cdquo": "1",
"codeUti": null,
"cdquo_text": "Revenus fiscaux"
}
],
"subscribeActivityList": [],
"civility_text": "MADAME",
"quality_text": "M\u00e8re"
},
"RL2": {
"num": "N/A",
"firstname": "HOMER",
"lastname": "N/A",
"maidenName": null,
"quality": "PERE",
"civility": "MR",
"birth": {
"dateBirth": "1956-05-12T00:00:00+01:00",
"place": "Brive-la-Gaillarde",
"communeCode": "19031",
"countryCode": null,
"cdDepartment": "19",
"communeCode_text": "BRIVE-LA-GAILLARDE",
"cdDepartment_text": "CORREZE",
"zipCode": "19100"
},
"adresse": {
"idStreet": "2317",
"num": 4,
"numComp": null,
"street1": "RUE ACHILLE VIADIEU",
"street2": null,
"town": "Toulouse",
"zipcode": "31400",
"idStreet_text": "RUE ACHILLE VIADIEU"
},
"contact": {
"phone": "0122222222",
"mobile": "0622222222",
"mail": "homer.simpson@example.org.com",
"isContactMail": true,
"isContactSms": true,
"isInvoicePdf": true
},
"profession": {
"codeCSP": "46",
"profession": "Inspecteur de s\u00e9curit\u00e9",
"employerName": "Burns",
"phone": "0133333333",
"addressPro": {
"num": null,
"street": null,
"zipcode": "90701",
"town": "Springfield"
},
"situation": null,
"weeklyHours": null,
"codeCSP_text": "EMPLOYES"
},
"CAFInfo": {
"number": "123",
"organ": "GENE",
"organ_text": "CAF 31"
},
"indicatorList": [
{
"code": "AVL",
"libelle": "Auxiliaire de Vie loisirs",
"note": null,
"choice": null,
"code_text": "Auxiliaire de Vie loisirs"
},
{
"code": "ETABSPEC",
"libelle": "Etablissement sp\u00e9cialis\u00e9",
"note": "SNPP",
"choice": null,
"code_text": "Etablissement sp\u00e9cialis\u00e9"
}
],
"quotientList": [],
"subscribeActivityList": [],
"civility_text": "MONSIEUR",
"quality_text": "P\u00e8re"
},
"quotientList": [],
"childList": [
{
"num": "N/A",
"lastname": "N/A",
"firstname": "BART",
"sexe": "M",
"birth": {
"dateBirth": "2014-04-01T00:00:00+02:00",
"place": "Brive-la-Gaillarde",
"communeCode": "19031",
"countryCode": null,
"cdDepartment": "19",
"communeCode_text": "BRIVE-LA-GAILLARDE",
"cdDepartment_text": "CORREZE",
"zipCode": "19100"
},
"dietcode": "MENU_AV",
"bPhoto": true,
"bLeaveAlone": true,
"authorizedPersonList": [
{
"personInfo": {
"num": "N/A",
"lastname": "TEST_SIMPSON",
"firstname": "ABRAHAM JEBEDIAH",
"dateBirth": "1927-05-24T00:00:00+01:00",
"civility": "MR",
"sexe": "M",
"contact": {
"phone": "0312345678",
"mobile": null,
"mail": "abe.simpson@example.org"
},
"civility_text": "MONSIEUR",
"sexe_text": "Masculin"
},
"personQuality": {
"code": "13",
"libelle": "Famille",
"code_text": "Famille"
}
},
{
"personInfo": {
"num": "N/A",
"lastname": "TEST_SIMPSON",
"firstname": "MONA PENELOPE",
"dateBirth": "1929-03-15T00:00:00Z",
"civility": "MME",
"sexe": "F",
"contact": {
"phone": "0412345678",
"mobile": "0612345678",
"mail": "mona.simpson@example.org"
},
"civility_text": "MADAME",
"sexe_text": "F\u00e9minin"
},
"personQuality": {
"code": "13",
"libelle": "Famille",
"code_text": "Famille"
}
}
],
"indicatorList": [
{
"code": "AUTRE",
"libelle": "Autre",
"note": "rebellious",
"choice": null,
"code_text": "Autre"
},
{
"code": "LUNETTE",
"libelle": "Port de lunettes",
"note": null,
"choice": null,
"code_text": "Port de lunettes"
}
],
"medicalRecord": {
"familyDoctor": {
"name": "MONROE",
"phone": "0612341234",
"address": {
"street1": "Alameda",
"zipcode": "90701",
"town": "Springfield"
}
},
"allergy1": "butterscotch, imitation butterscotch, glow-in-the-dark monster make-up",
"allergy2": "shrimp and cauliflower",
"comment1": "the shrimp allergy isn't fully identified",
"comment2": null,
"observ1": "Ay Caramba!",
"observ2": "Eat my shorts!",
"isAuthHospital": false,
"hospital": null,
"vaccinList": [
{
"code": "24",
"libelle": "IMOVAX OREILLONS",
"vaccinationDate": "2022-02-22T00:00:00+01:00"
},
{
"code": "45",
"libelle": "DT TETANOS COQ",
"vaccinationDate": "2011-01-11T00:00:00+01:00"
}
]
},
"insurance": null,
"paiInfoBean": {
"code": "PAI_01",
"dateDeb": "2022-09-01T00:00:00+02:00",
"dateFin": "2023-07-01T00:00:00+02:00",
"description": "mischievous, rebellious, misunderstood, disruptive",
"code_text": "PAI Alimentaire Int\u00e9gral"
},
"mother": "N/A",
"father": "N/A",
"rl": null,
"subscribeSchoolList": [],
"subscribeActivityList": [],
"sexe_text": "Masculin",
"dietcode_text": "Avec viande"
},
{
"num": "N/A",
"lastname": "N/A",
"firstname": "LISA",
"sexe": "F",
"birth": {
"dateBirth": "2016-05-09T00:00:00+02:00",
"place": null,
"communeCode": null,
"countryCode": null,
"cdDepartment": null
},
"dietcode": "MENU_SV",
"bPhoto": false,
"bLeaveAlone": false,
"authorizedPersonList": [],
"indicatorList": [],
"medicalRecord": null,
"insurance": null,
"paiInfoBean": {
"code": "PAI_02",
"dateDeb": null,
"dateFin": null,
"description": null,
"code_text": "PAI Alimentaire Partiel"
},
"mother": "N/A",
"father": "N/A",
"rl": null,
"subscribeSchoolList": [],
"subscribeActivityList": [],
"sexe_text": "F\u00e9minin",
"dietcode_text": "Sans viande"
},
{
"num": "N/A",
"lastname": "N/A",
"firstname": "MAGGIE",
"sexe": "F",
"birth": {
"dateBirth": "2018-12-17T00:00:00+01:00",
"place": null,
"communeCode": null,
"countryCode": null,
"cdDepartment": null
},
"dietcode": "MENU_PAI",
"bPhoto": false,
"bLeaveAlone": false,
"authorizedPersonList": [],
"indicatorList": [],
"medicalRecord": null,
"insurance": null,
"paiInfoBean": {
"code": "PAI_02",
"dateDeb": null,
"dateFin": null,
"description": null,
"code_text": "PAI Alimentaire Partiel"
},
"mother": "N/A",
"father": "N/A",
"rl": null,
"subscribeSchoolList": [],
"subscribeActivityList": [],
"sexe_text": "F\u00e9minin",
"dietcode_text": "Panier PAI"
},
{
"num": "N/A",
"lastname": "N/A",
"firstname": "HUGO",
"sexe": "M",
"birth": {
"dateBirth": "2018-04-01T00:00:00+02:00",
"place": null,
"communeCode": null,
"countryCode": null,
"cdDepartment": null
},
"dietcode": "MENU_AV",
"bPhoto": false,
"bLeaveAlone": false,
"authorizedPersonList": [],
"indicatorList": [],
"medicalRecord": null,
"insurance": null,
"paiInfoBean": {
"code": "PAI_01",
"dateDeb": null,
"dateFin": null,
"description": null,
"code_text": "PAI Alimentaire Int\u00e9gral"
},
"mother": "N/A",
"father": "N/A",
"rl": null,
"subscribeSchoolList": [],
"subscribeActivityList": [],
"sexe_text": "Masculin",
"dietcode_text": "Avec viande"
}
],
"emergencyPersonList": [
{
"numPerson": "N/A",
"civility": "MME",
"firstname": "PATTY",
"lastname": "BOUVIER",
"dateBirth": "1948-08-30T00:00:00+01:00",
"sexe": "F",
"quality": "13",
"contact": {
"phone": "0112345678",
"mobile": "0612345678",
"mail": "patty.bouvier@example.org"
},
"civility_text": "MADAME",
"quality_text": "Famille",
"sexe_text": "F\u00e9minin"
},
{
"numPerson": "N/A",
"civility": "MME",
"firstname": "SELMA",
"lastname": "BOUVIER",
"dateBirth": "1946-04-29T00:00:00+01:00",
"sexe": "F",
"quality": "13",
"contact": {
"phone": "0112345678",
"mobile": "0612345678",
"mail": "selma.bouvier@example.org"
},
"civility_text": "MADAME",
"quality_text": "Famille",
"sexe_text": "F\u00e9minin"
}
],
"indicatorList": [],
"childErrorList": [],
"category_text": "BIPARENTALE",
"situation_text": "MARIE(E)",
"family_id": "N/A"
}

View File

@ -12,7 +12,8 @@
"countryCode": null,
"cdDepartment": "19",
"communeCode_text": "BRIVE-LA-GAILLARDE",
"cdDepartment_text": "CORREZE"
"cdDepartment_text": "CORREZE",
"zipCode": "19100"
},
"adresse": {
"idStreet": null,

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

@ -1,4 +1,11 @@
[
{
"id": "87",
"code": "87",
"rang": "PERSON",
"text": "Acte de d\u00e9c\u00e8s",
"libelle": "Acte de d\u00e9c\u00e8s"
},
{
"id": "43",
"code": "43",
@ -188,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

@ -13,17 +13,8 @@
"text": "2023",
"schoolYear": 2023,
"dateEndYearSchool": "2024-07-07T00:00:00+02:00",
"dateStartYearSchool": "2023-09-01T00:00:00+02:00",
"dateStartYearSchool": "2023-09-04T00:00:00+02:00",
"dateEndSubscribeSchool": "2023-09-01T00:00:00+02:00",
"dateStartSubscribeSchool": "2022-09-01T00:00:00+02:00"
},
{
"id": 2024,
"text": "2024",
"schoolYear": 2024,
"dateEndYearSchool": "2024-07-04T00:00:00+02:00",
"dateStartYearSchool": "2023-09-04T00:00:00+02:00",
"dateEndSubscribeSchool": null,
"dateStartSubscribeSchool": null
}
]

View File

@ -8,8 +8,8 @@
{
"id": "30",
"code": "30",
"text": "B.C.G.",
"libelle": "B.C.G."
"text": "BCG",
"libelle": "BCG"
},
{
"id": "56",
@ -74,8 +74,8 @@
{
"id": "8",
"code": "8",
"text": "DT POLIO",
"libelle": "DT POLIO"
"text": "DTPOLIO",
"libelle": "DTPOLIO"
},
{
"id": "45",
@ -128,8 +128,8 @@
{
"id": "29",
"code": "29",
"text": "HEPATITE B",
"libelle": "HEPATITE B"
"text": "HEPATITEB",
"libelle": "HEPATITEB"
},
{
"id": "146",
@ -149,6 +149,12 @@
"text": "HIB",
"libelle": "HIB"
},
{
"id": "152",
"code": "152",
"text": "IIP",
"libelle": "IIP"
},
{
"id": "24",
"code": "24",
@ -221,6 +227,12 @@
"text": "MENINGITEC",
"libelle": "MENINGITEC"
},
{
"id": "151",
"code": "151",
"text": "MENINGOCOQUE",
"libelle": "MENINGOCOQUE"
},
{
"id": "123",
"code": "123",
@ -287,6 +299,12 @@
"text": "PENTAVAC",
"libelle": "PENTAVAC"
},
{
"id": "150",
"code": "150",
"text": "POLIO",
"libelle": "POLIO"
},
{
"id": "2",
"code": "2",
@ -320,8 +338,8 @@
{
"id": "28",
"code": "28",
"text": "R O R",
"libelle": "R O R"
"text": "ROR",
"libelle": "ROR"
},
{
"id": "127",
@ -386,8 +404,8 @@
{
"id": "12",
"code": "12",
"text": "TETRA COQ",
"libelle": "TETRA COQ"
"text": "TETRACOQ",
"libelle": "TETRACOQ"
},
{
"id": "46",

View File

@ -18,7 +18,7 @@
{
"personInfo": {
"num": "N/A",
"lastname": "SIMPSON",
"lastname": "TEST_SIMPSON",
"firstname": "ABRAHAM JEBEDIAH",
"dateBirth": "1927-05-24T00:00:00+01:00",
"civility": "MR",
@ -40,7 +40,7 @@
{
"personInfo": {
"num": "N/A",
"lastname": "SIMPSON",
"lastname": "TEST_SIMPSON",
"firstname": "MONA PENELOPE",
"dateBirth": "1929-03-15T00:00:00Z",
"civility": "MME",

View File

@ -19,7 +19,7 @@
{
"personInfo": {
"num": "N/A",
"lastname": "SIMPSON",
"lastname": "TEST_SIMPSON",
"firstname": "MONA PENELOPE",
"dateBirth": "1929-03-15T00:00:00Z",
"civility": "MME",

View File

@ -27,8 +27,8 @@
"numComp": null,
"street1": "RUE ACHILLE VIADIEU",
"street2": null,
"town": "Springfield",
"zipcode": "62701",
"town": "Toulouse",
"zipcode": "31400",
"idStreet_text": "RUE ACHILLE VIADIEU"
},
"contact": {
@ -61,7 +61,8 @@
"countryCode": null,
"cdDepartment": "19",
"communeCode_text": "BRIVE-LA-GAILLARDE",
"cdDepartment_text": "CORREZE"
"cdDepartment_text": "CORREZE",
"zipCode": "19100"
},
"adresse": {
"idStreet": null,
@ -135,7 +136,8 @@
"countryCode": null,
"cdDepartment": "19",
"communeCode_text": "BRIVE-LA-GAILLARDE",
"cdDepartment_text": "CORREZE"
"cdDepartment_text": "CORREZE",
"zipCode": "19100"
},
"dietcode": "MENU_AV",
"bPhoto": true,
@ -144,7 +146,7 @@
{
"personInfo": {
"num": "N/A",
"lastname": "SIMPSON",
"lastname": "TEST_SIMPSON",
"firstname": "ABRAHAM JEBEDIAH",
"dateBirth": "1927-05-24T00:00:00+01:00",
"civility": "MR",
@ -166,7 +168,7 @@
{
"personInfo": {
"num": "N/A",
"lastname": "SIMPSON",
"lastname": "TEST_SIMPSON",
"firstname": "MONA PENELOPE",
"dateBirth": "1929-03-15T00:00:00Z",
"civility": "MME",

View File

@ -2,7 +2,7 @@
"number": "N/A",
"category": "AUTR",
"situation": "AUTR",
"flagCom": true,
"flagCom": false,
"nbChild": 0,
"nbTotalChild": 0,
"nbAES": "0",

View File

@ -4,24 +4,33 @@
"dateStart": "2022-01-02T00:00:00+01:00",
"dateEnd": "2022-12-31T00:00:00+01:00",
"mtt": 1500.33,
"cdquo": "1",
"cdquo": "2",
"codeUti": null,
"cdquo_text": "Revenus fiscaux"
"cdquo_text": "Revenus Petite enfance"
},
{
"yearRev": 2021,
"dateStart": "2022-01-01T00:00:00+01:00",
"dateEnd": "2022-01-01T00:00:00+01:00",
"mtt": 1500.33,
"cdquo": "1",
"cdquo": "2",
"codeUti": null,
"cdquo_text": "Revenus fiscaux"
"cdquo_text": "Revenus Petite enfance"
},
{
"yearRev": 2021,
"dateStart": "2022-01-02T00:00:00+01:00",
"dateEnd": "2022-12-31T00:00:00+01:00",
"mtt": 1500.33,
"cdquo": "2",
"codeUti": null,
"cdquo_text": "Revenus Petite enfance"
},
{
"yearRev": 2022,
"dateStart": "2022-09-01T00:00:00+02:00",
"dateEnd": "3000-08-31T00:00:00+02:00",
"mtt": 5000.0,
"cdquo": "1",
"codeUti": null,
"cdquo_text": "Revenus fiscaux"

View File

@ -18,8 +18,8 @@
"numComp": null,
"street1": "RUE ACHILLE VIADIEU",
"street2": null,
"town": "Springfield",
"zipcode": "62701",
"town": "Toulouse",
"zipcode": "31400",
"idStreet_text": "RUE ACHILLE VIADIEU"
},
"contact": {

View File

@ -15,7 +15,7 @@ FAMILY_RESET_PAYLOAD = {
'rl1': {
'civility': 'MR', # no effect
'firstname': 'Marge', # must be
'lastname': 'Simpson', # must be
'lastname': 'Test_Simpson', # must be
'maidenName': 'reset', # no effect
'quality': 'AU',
'birth': {
@ -27,7 +27,7 @@ FAMILY_RESET_PAYLOAD = {
'rl2': {
'civility': 'MME', # no effect
'firstname': 'Homer', # must be
'lastname': 'Simpson', # must be
'lastname': 'Test_Simpson', # must be
'quality': 'AU',
'birth': {
'dateBirth': '1956-05-12', # must be
@ -236,13 +236,18 @@ def test_update_family(conn, update_data):
def test_create_family(conn, create_data, update_data):
unlink(conn, create_data['name_id'])
link(conn, create_data)
# search the 'Test_Simpson' default test family
resp = requests.get(conn + '/search-family?q=Test_Simpson')
resp.raise_for_status()
assert len(resp.json()['data']) >= 1
assert any(data['RL1']['lastname'] == 'TEST_SIMPSON' for data in resp.json()['data'])
url = conn + '/create-family?NameID=%s' % create_data['name_id']
# RL1 already exists (on update_data) error
unlink(conn, create_data['name_id'])
payload = copy.deepcopy(create_data['family_payload'])
payload['rl1']['lastname'] = 'Simpson'
payload['rl1']['lastname'] = 'Test_Simpson'
resp = requests.post(url, json=payload)
resp.raise_for_status()
res = resp.json()
@ -263,7 +268,7 @@ def test_create_family(conn, create_data, update_data):
def test_is_rl_exists(conn, update_data):
url = conn + '/is-rl-exists'
payload = {'firstname': 'Marge', 'lastname': 'Simpson', 'dateBirth': '1950-10-01'}
payload = {'firstname': 'Marge', 'lastname': 'Test_Simpson', 'dateBirth': '1950-10-01'}
resp = requests.post(url, json=payload)
resp.raise_for_status()
assert resp.json() == {'err': 0, 'data': True}
@ -280,7 +285,7 @@ def test_is_rl_exists(conn, update_data):
assert resp.json() == {'err': 0, 'data': False}
# test on rl2
payload = {'firstname': 'Homer', 'lastname': 'Simpson', 'dateBirth': '1956-05-12'}
payload = {'firstname': 'Homer', 'lastname': 'Test_Simpson', 'dateBirth': '1956-05-12'}
resp = requests.post(url, json=payload)
resp.raise_for_status()
assert resp.json() == {'err': 0, 'data': True}
@ -454,7 +459,7 @@ def test_create_child(conn, create_data, update_data):
assert 'E65 : Il existe déjà un enfant correspondant' in res['err_desc']
# child already exists error (Lisa form update_data)
payload['lastname'] = 'Simpson'
payload['lastname'] = 'Test_Simpson'
resp = requests.post(url, json=payload)
resp.raise_for_status()
res = resp.json()