Compare commits
16 Commits
0d1044503c
...
f65b930a2f
Author | SHA1 | Date |
---|---|---|
Nicolas Roche | f65b930a2f | |
Nicolas Roche | 978a15fdbe | |
Nicolas Roche | 79ebceb459 | |
Nicolas Roche | db7a2fc925 | |
Nicolas Roche | 6f461e6366 | |
Nicolas Roche | 433afc6a24 | |
Nicolas Roche | 13450d32a5 | |
Nicolas Roche | 07975f7685 | |
Nicolas Roche | 0c4571384b | |
Nicolas Roche | 31d9c6e796 | |
Nicolas Roche | 87063d9485 | |
Nicolas Roche | ad7ac9e0e7 | |
Nicolas Roche | a3168ae8ad | |
Nicolas Roche | 5b617a3867 | |
Nicolas Roche | 71e04a76df | |
Nicolas Roche | 7c75504cf7 |
|
@ -75,7 +75,8 @@ def test_displaying_school_subscribed(conn, create_data, school_year, exemption)
|
|||
res = resp.json()
|
||||
assert res['err'] == 0
|
||||
schools = [x['subscribeSchoolList'] for x in res['data']['childList'] if x['num'] == claris_id][0]
|
||||
assert len(schools) == 0 # school is filtered, see dateStartYearSchool before
|
||||
assert len(schools) == 0 # school is filtered, but it is related to an hidden school year
|
||||
# field, not dateStartYearSchool, checked before : #2425
|
||||
|
||||
|
||||
def test_school_pre_registration_by_sector(conn, create_data, school_year, exemption):
|
||||
|
@ -145,7 +146,9 @@ def test_school_pre_registration_by_sector(conn, create_data, school_year, exemp
|
|||
resp.raise_for_status()
|
||||
res = resp.json()['data']
|
||||
date_start = [x['dateStartYearSchool'] for x in res if x['text'] == school_year][0]
|
||||
assert date_start[10] > datetime.datetime.now().strftime('%Y-%m-%d') # bug ?
|
||||
assert date_start[10] > datetime.datetime.now().strftime('%Y-%m-%d')
|
||||
# school is filtered, but it is related to an hidden school year
|
||||
# field, not dateStartYearSchool, see #2425
|
||||
|
||||
url = conn + '/read-family?NameID=%s' % create_data['name_id']
|
||||
resp = requests.get(url)
|
||||
|
|
|
@ -59,6 +59,12 @@ def test_catalog_general_loisirs(conn, update_data):
|
|||
'place': {'text': 'Lieu', 'data': {'A10053179757': 'ARGOULETS'}, 'order': ['A10053179757']},
|
||||
'service': {'text': 'Service', 'data': {'A10049329046': 'Sports'}, 'order': ['A10049329046']},
|
||||
}
|
||||
assert item['activity']['activityPortail']['blocNoteList'] == [
|
||||
{
|
||||
'note': "Activité ayant lieu le Mercredi, merci de choisir votre tranche horraire en fonction de l'âge de votre enfant.",
|
||||
'numIndex': 1,
|
||||
}
|
||||
]
|
||||
if item['text'] == 'Promenade forêt enchantée, TEST promenade forêt enchantée, TERRITOIRE OUEST':
|
||||
assert item['criterias'] == {
|
||||
'nature': {
|
||||
|
@ -84,6 +90,9 @@ def test_catalog_general_loisirs(conn, update_data):
|
|||
},
|
||||
'service': {'text': 'Service', 'data': {'A10049329050': 'Sports'}, 'order': ['A10049329050']},
|
||||
}
|
||||
assert item['activity']['activityPortail']['blocNoteList'] == [
|
||||
{'note': 'Activité de promenade en forêt.', 'numIndex': 1}
|
||||
]
|
||||
|
||||
|
||||
def test_catalog_personnalise_loisirs(loisirs_subscribe_info):
|
||||
|
|
|
@ -201,7 +201,6 @@ def test_basket_subscribe_extrasco(conn, create_data, extrasco_subscribe_info, r
|
|||
assert subscriptions(create_data['bart_num']) == []
|
||||
|
||||
|
||||
@pytest.mark.xfail(run=False)
|
||||
def test_basket_subscribe_extrasco2(conn, create_data, extrasco_subscribe_info2, reference_year):
|
||||
"""Subscribing to a generic unit"""
|
||||
assert extrasco_subscribe_info2['info']['controlResult']['controlOK'] is True
|
||||
|
@ -390,19 +389,16 @@ def test_basket_subscribe_extrasco2(conn, create_data, extrasco_subscribe_info2,
|
|||
assert [x['booked'] for x in resp.json()['changes']] == [True, True]
|
||||
assert len([x['prefill'] for x in get_bookings(create_data['maggie_num']) if x['prefill'] is True]) == 2
|
||||
|
||||
# validate basket
|
||||
url = conn + '/validate-basket?NameID=%s' % create_data['name_id']
|
||||
# delete basket
|
||||
url = conn + '/delete-basket?NameID=%s' % create_data['name_id']
|
||||
payload = {'basket_id': basket_id}
|
||||
resp = requests.post(url, json=payload)
|
||||
resp.raise_for_status()
|
||||
assert resp.json()['err'] == 0
|
||||
data = resp.json()['data']
|
||||
assert len(data['idInsLst']) == 2 # 6 sur Larden
|
||||
assert len(data['factureLst']) == 0 # No invoice #2187
|
||||
assert resp.json()['data'] == 'ok'
|
||||
assert get_baskets() == []
|
||||
|
||||
assert len(subscriptions(create_data['bart_num'])) == 2
|
||||
assert len(subscriptions(create_data['maggie_num'])) == 2
|
||||
assert subscriptions(create_data['bart_num']) == []
|
||||
assert subscriptions(create_data['maggie_num']) == []
|
||||
|
||||
|
||||
def test_basket_subscribe_loisirs(conn, create_data, loisirs_subscribe_info, reference_year):
|
||||
|
|
|
@ -63,6 +63,8 @@ Réservations (agenda)
|
|||
.....................
|
||||
$ ./get_person_schedule_list.py -e dev -f 322423 -P 261768 A10055585940 -y 2023 -m 4
|
||||
$ ./update_person_schedule_list.py -e dev -f 322423 -P 261768 -a A10055585940 -u A10055585942 -D "2023-04-12" -A ADD_PRES_PREVI
|
||||
$ ./get_calendar_period_quantity.py -e dev -P 218841 -a A10056523296 -u A10056523298 -S 2023-06-12 -E 2023-06-23
|
||||
$ ./update_person_unit_basket.py -e dev -l S10056971773 -q 2
|
||||
|
||||
Réservations (semaine type)
|
||||
...........................
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
|
||||
import utils
|
||||
|
||||
PERSON_ID = '263781' # BART
|
||||
ACTIVITY_ID = 'A10055227963'
|
||||
UNIT_ID = 'A10055227965'
|
||||
START_DATE = '2023-02-01'
|
||||
END_DATE = '2023-07-01'
|
||||
|
||||
|
||||
def check(args):
|
||||
utils.configure_logging(args.verbose)
|
||||
client = utils.get_client(args.env, 'Activity')
|
||||
|
||||
result = client.service.getCalendarPeriodQuantity(
|
||||
numPerson=args.person,
|
||||
idAct=args.activity,
|
||||
idUni=args.unit,
|
||||
dateStart=args.start,
|
||||
dateEnd=args.end,
|
||||
)
|
||||
print(result)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--verbose', '-v', type=int, default=2, help='display errors')
|
||||
parser.add_argument('--env', '-e', default='integ', help='dev, test, integ, prod')
|
||||
parser.add_argument('--person', '-P', default=PERSON_ID, help='person id')
|
||||
parser.add_argument('--activity', '-a', default=ACTIVITY_ID, help='activity id')
|
||||
parser.add_argument('--unit', '-u', default=UNIT_ID, help='unit id')
|
||||
parser.add_argument('--start', '-S', default=START_DATE, help='start date (ex: 2023-02-01)')
|
||||
parser.add_argument('--end', '-E', default=END_DATE, help='end date (ex: 2023-07-01)')
|
||||
check(parser.parse_args())
|
Loading…
Reference in New Issue