From e852d7e2f360ff9c750defd0bd0e075a72289aeb Mon Sep 17 00:00:00 2001 From: Nicolas ROCHE Date: Sat, 15 Apr 2023 12:17:07 +0200 Subject: [PATCH] toujouse-maelis: [functests] add birth informations (#76608) --- functests/toulouse_maelis/conftest.py | 21 ++++++++++++++++--- .../data/test_create_family.json | 13 +++++++----- .../toulouse_maelis/data/test_create_rl2.json | 8 ++++--- .../data/test_update_child.json | 5 +++-- .../data/test_update_family.json | 21 ++++++++++++------- .../data/test_update_family_ras.json | 10 +++++---- .../toulouse_maelis/data/test_update_rl2.json | 5 +++-- functests/toulouse_maelis/test_00_data.py | 3 ++- functests/toulouse_maelis/test_02_family.py | 21 ++++++++++++++++--- functests/toulouse_maelis/test_04_loisirs.py | 7 +++++-- 10 files changed, 81 insertions(+), 33 deletions(-) diff --git a/functests/toulouse_maelis/conftest.py b/functests/toulouse_maelis/conftest.py index 24008303..c86db293 100644 --- a/functests/toulouse_maelis/conftest.py +++ b/functests/toulouse_maelis/conftest.py @@ -24,7 +24,10 @@ FAMILY_PAYLOAD = { 'lastname': 'Simpson', 'maidenName': 'Bouvier', 'quality': 'MERE', - 'birth': {'dateBirth': '1950-10-01'}, + 'birth': { + 'dateBirth': '1950-10-01', + 'countryCode': '404', + }, 'adresse': { 'idStreet': '2317', 'num': '4', @@ -38,7 +41,13 @@ FAMILY_PAYLOAD = { 'firstname': 'Homer', 'lastname': 'Simpson', 'quality': 'PERE', - 'birth': {'dateBirth': '1956-05-12'}, + 'birth': { + 'dateBirth': '1956-05-12', + 'place': 'Brive-la-Gaillarde', + 'communeCode': '19031', + 'cdDepartment': '19', + 'countryCode': '', + }, 'adresse': { 'num': '742', 'numComp': None, @@ -88,7 +97,13 @@ FAMILY_PAYLOAD = { 'sexe': 'M', 'firstname': 'Bart', 'lastname': 'Simpson', - 'birth': {'dateBirth': '2014-04-01'}, + 'birth': { + 'dateBirth': '2014-04-01', + 'place': 'Brive-la-Gaillarde', + 'communeCode': '19031', + 'cdDepartment': '19', + 'countryCode': '', + }, 'bPhoto': True, 'bLeaveAlone': True, 'dietcode': 'MENU_AV', diff --git a/functests/toulouse_maelis/data/test_create_family.json b/functests/toulouse_maelis/data/test_create_family.json index 46cef3ce..8f447a31 100644 --- a/functests/toulouse_maelis/data/test_create_family.json +++ b/functests/toulouse_maelis/data/test_create_family.json @@ -17,8 +17,9 @@ "dateBirth": "1950-10-01T00:00:00+01:00", "place": null, "communeCode": null, - "countryCode": null, - "cdDepartment": null + "countryCode": "404", + "cdDepartment": null, + "countryCode_text": "USA" }, "adresse": { "idStreet": "2317", @@ -56,10 +57,12 @@ "sexe": "M", "birth": { "dateBirth": "2014-04-01T00:00:00+02:00", - "place": null, - "communeCode": null, + "place": "Brive-la-Gaillarde", + "communeCode": "19031", "countryCode": null, - "cdDepartment": null + "cdDepartment": "19", + "communeCode_text": "BRIVE-LA-GAILLARDE", + "cdDepartment_text": "CORREZE" }, "dietcode": "MENU_AV", "bPhoto": true, diff --git a/functests/toulouse_maelis/data/test_create_rl2.json b/functests/toulouse_maelis/data/test_create_rl2.json index 938f6940..e7f8b5f6 100644 --- a/functests/toulouse_maelis/data/test_create_rl2.json +++ b/functests/toulouse_maelis/data/test_create_rl2.json @@ -7,10 +7,12 @@ "civility": "MR", "birth": { "dateBirth": "1956-05-12T00:00:00+01:00", - "place": null, - "communeCode": null, + "place": "Brive-la-Gaillarde", + "communeCode": "19031", "countryCode": null, - "cdDepartment": null + "cdDepartment": "19", + "communeCode_text": "BRIVE-LA-GAILLARDE", + "cdDepartment_text": "CORREZE" }, "adresse": { "idStreet": null, diff --git a/functests/toulouse_maelis/data/test_update_child.json b/functests/toulouse_maelis/data/test_update_child.json index d4a61fac..91d4cab6 100644 --- a/functests/toulouse_maelis/data/test_update_child.json +++ b/functests/toulouse_maelis/data/test_update_child.json @@ -7,8 +7,9 @@ "dateBirth": "1970-01-01T00:00:00+01:00", "place": null, "communeCode": null, - "countryCode": null, - "cdDepartment": null + "countryCode": "404", + "cdDepartment": null, + "countryCode_text": "USA" }, "dietcode": "MENU_AV", "bPhoto": false, diff --git a/functests/toulouse_maelis/data/test_update_family.json b/functests/toulouse_maelis/data/test_update_family.json index 89ac6bcf..f949254c 100644 --- a/functests/toulouse_maelis/data/test_update_family.json +++ b/functests/toulouse_maelis/data/test_update_family.json @@ -17,8 +17,9 @@ "dateBirth": "1950-10-01T00:00:00+01:00", "place": null, "communeCode": null, - "countryCode": null, - "cdDepartment": null + "countryCode": "404", + "cdDepartment": null, + "countryCode_text": "USA" }, "adresse": { "idStreet": "2317", @@ -55,10 +56,12 @@ "civility": "MR", "birth": { "dateBirth": "1956-05-12T00:00:00+01:00", - "place": null, - "communeCode": null, + "place": "Brive-la-Gaillarde", + "communeCode": "19031", "countryCode": null, - "cdDepartment": null + "cdDepartment": "19", + "communeCode_text": "BRIVE-LA-GAILLARDE", + "cdDepartment_text": "CORREZE" }, "adresse": { "idStreet": null, @@ -127,10 +130,12 @@ "sexe": "M", "birth": { "dateBirth": "2014-04-01T00:00:00+02:00", - "place": null, - "communeCode": null, + "place": "Brive-la-Gaillarde", + "communeCode": "19031", "countryCode": null, - "cdDepartment": null + "cdDepartment": "19", + "communeCode_text": "BRIVE-LA-GAILLARDE", + "cdDepartment_text": "CORREZE" }, "dietcode": "MENU_AV", "bPhoto": true, diff --git a/functests/toulouse_maelis/data/test_update_family_ras.json b/functests/toulouse_maelis/data/test_update_family_ras.json index 8765452b..cfebfcf7 100644 --- a/functests/toulouse_maelis/data/test_update_family_ras.json +++ b/functests/toulouse_maelis/data/test_update_family_ras.json @@ -56,8 +56,9 @@ "dateBirth": "1956-05-12T00:00:00+01:00", "place": null, "communeCode": null, - "countryCode": null, - "cdDepartment": null + "countryCode": "404", + "cdDepartment": null, + "countryCode_text": "USA" }, "adresse": { "idStreet": null, @@ -113,8 +114,9 @@ "dateBirth": "1970-01-01T00:00:00+01:00", "place": null, "communeCode": null, - "countryCode": null, - "cdDepartment": null + "countryCode": "404", + "cdDepartment": null, + "countryCode_text": "USA" }, "dietcode": null, "bPhoto": false, diff --git a/functests/toulouse_maelis/data/test_update_rl2.json b/functests/toulouse_maelis/data/test_update_rl2.json index 8d457349..dad93980 100644 --- a/functests/toulouse_maelis/data/test_update_rl2.json +++ b/functests/toulouse_maelis/data/test_update_rl2.json @@ -9,8 +9,9 @@ "dateBirth": "1956-05-12T00:00:00+01:00", "place": null, "communeCode": null, - "countryCode": null, - "cdDepartment": null + "countryCode": "404", + "cdDepartment": null, + "countryCode_text": "USA" }, "adresse": { "idStreet": null, diff --git a/functests/toulouse_maelis/test_00_data.py b/functests/toulouse_maelis/test_00_data.py index 87d80577..9a836563 100644 --- a/functests/toulouse_maelis/test_00_data.py +++ b/functests/toulouse_maelis/test_00_data.py @@ -11,6 +11,7 @@ from .conftest import diff 'child-indicator', 'civility', 'country', + 'county', 'csp', 'dietcode', 'document', @@ -34,5 +35,5 @@ def test_referentials(conn, referentials, ref): for item in res['data']: assert 'id' in item assert 'text' in item - if ref not in ['street']: + if ref not in ['street', 'county']: assert diff(res['data'], 'test_read_%s_list.json' % ref) diff --git a/functests/toulouse_maelis/test_02_family.py b/functests/toulouse_maelis/test_02_family.py index a7083976..58559960 100644 --- a/functests/toulouse_maelis/test_02_family.py +++ b/functests/toulouse_maelis/test_02_family.py @@ -18,7 +18,10 @@ FAMILY_RESET_PAYLOAD = { 'lastname': 'Simpson', # must be 'maidenName': 'reset', # no effect 'quality': 'AU', - 'birth': {'dateBirth': '1950-10-01'}, # must be + 'birth': { + 'dateBirth': '1950-10-01', # must be + 'countryCode': '', + }, 'adresse': {'idStreet': '', 'street1': 'reset', 'town': 'reset', 'zipcode': 'reset'}, }, 'rl2': { @@ -26,7 +29,13 @@ FAMILY_RESET_PAYLOAD = { 'firstname': 'Homer', # must be 'lastname': 'Simpson', # must be 'quality': 'AU', - 'birth': {'dateBirth': '1956-05-12'}, # must be + 'birth': { + 'dateBirth': '1956-05-12', # must be + 'place': '', + 'communeCode': '', + 'cdDepartment': '', + 'countryCode': '404', + }, 'adresse': { 'num': '42', 'numComp': 'Q', @@ -71,7 +80,13 @@ FAMILY_RESET_PAYLOAD = { 'sexe': 'F', 'firstname': 'Bartolome', # some side effects, cf test_update_child 'lastname': 'Simps', - 'birth': {'dateBirth': '1970-01-01'}, + 'birth': { + 'dateBirth': '1970-01-01', + 'place': '', + 'communeCode': '', + 'cdDepartment': '', + 'countryCode': '404', + }, 'bPhoto': False, 'bLeaveAlone': False, 'dietcode': '', diff --git a/functests/toulouse_maelis/test_04_loisirs.py b/functests/toulouse_maelis/test_04_loisirs.py index 80e34f22..47acfe73 100644 --- a/functests/toulouse_maelis/test_04_loisirs.py +++ b/functests/toulouse_maelis/test_04_loisirs.py @@ -17,5 +17,8 @@ def test_catalog_general_loisirs(conn, update_data): resp.raise_for_status() assert resp.json()['err'] == 0 - # still not nature code defined on LOISIR activities - assert len(resp.json()['data']) == 0 + [x['text'] for x in resp.json()['data']] == [ + 'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES, MERCREDI - 13h45/17h - 8/15Ans, ARGOULETS', + 'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES, MERCREDI - 14h/16h30 - 10/15Ans, LA RAMEE', + 'TEST ECOLE DES SPORTS 22/23 SEMESTRE 2 - MULTIACTIVITES, MERCREDI - 15h30/17h - 8/15Ans, ARGOULETS', + ]