passerelle/functests/toulouse_maelis/test_04_loisirs.py

25 lines
874 B
Python

import datetime
import requests
from .conftest import link, unlink
# LOISIR is a subset of EXTRACO, we only test the genaral catalog cell here
def test_catalog_general_loisirs(conn, update_data):
unlink(conn, update_data['name_id'])
link(conn, update_data)
url = conn + '/read-activity-list'
params = {'ref_date': datetime.date.today().strftime('%Y-%m-%d')}
resp = requests.get(url, params=params)
resp.raise_for_status()
assert resp.json()['err'] == 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',
]