153 |
153 |
'booking_list_GARD': ['3535:GARD:A19P1M4:wednesday'],
|
154 |
154 |
'child_id': '3535',
|
155 |
155 |
'regime': 'AV',
|
|
156 |
'booking_date': '2019-08-01',
|
156 |
157 |
}
|
157 |
158 |
|
158 |
159 |
|
... | ... | |
3796 |
3797 |
assert 'ACTIVITE' not in payload['ENFANT'][0]
|
3797 |
3798 |
|
3798 |
3799 |
|
3799 |
|
def test_clae_booking_annual_reference_year(app, resource, annual_booking_params, child_activities_data):
|
|
3800 |
@freezegun.freeze_time('2019-09-01')
|
|
3801 |
def test_clae_booking_annual_next_year(app, resource, child_activities_data):
|
3800 |
3802 |
Link.objects.create(resource=resource, name_id='yyy', dui='XXX', person_id='42')
|
3801 |
3803 |
activities = child_activities_data['ENFANT'][0]
|
3802 |
|
with freezegun.freeze_time('2020-04-16'):
|
3803 |
|
with mock.patch('passerelle.contrib.toulouse_axel.models.ToulouseAxel.get_child_activities', return_value=activities):
|
3804 |
|
with mock.patch('passerelle.contrib.toulouse_axel.schemas.reservation_annuelle') as operation:
|
3805 |
|
operation.return_value = schemas.OperationResult(json_response={}, xml_request='', xml_response='')
|
3806 |
|
app.post_json('/toulouse-axel/test/clae_booking_annual?NameID=yyy', params=annual_booking_params)
|
3807 |
|
payload = operation.call_args_list[0][0][1]['PORTAIL']['DUI']
|
3808 |
|
assert payload['ENFANT'][0]['ACTIVITE'][0]['PERIODE'][0]['DATEDEBUT'] == '2020-04-24'
|
3809 |
|
assert payload['ENFANT'][0]['ACTIVITE'][0]['PERIODE'][0]['DATEDFIN'] == '2020-07-31'
|
3810 |
|
with freezegun.freeze_time('2020-08-01'):
|
3811 |
|
with mock.patch('passerelle.contrib.toulouse_axel.models.ToulouseAxel.get_child_activities', return_value=activities):
|
3812 |
|
with mock.patch('passerelle.contrib.toulouse_axel.schemas.reservation_annuelle') as operation:
|
3813 |
|
operation.return_value = schemas.OperationResult(json_response={}, xml_request='', xml_response='')
|
3814 |
|
app.post_json('/toulouse-axel/test/clae_booking_annual?NameID=yyy', params=annual_booking_params)
|
|
3804 |
for activity in activities['ACTIVITE']:
|
|
3805 |
activity['DATEDEBUT'] = '2020-08-01'
|
|
3806 |
activity['DATEENTREE'] = '2020-08-01'
|
|
3807 |
activity['DATEFIN'] = '2021-07-31'
|
|
3808 |
activity['DATESORTIE'] = '2021-07-31'
|
|
3809 |
annual_booking_params = {
|
|
3810 |
'booking_list_MAT': [],
|
|
3811 |
'booking_list_MIDI': None,
|
|
3812 |
'booking_list_SOIR': None,
|
|
3813 |
'booking_list_GARD': None,
|
|
3814 |
'child_id': '3535',
|
|
3815 |
'regime': 'AV',
|
|
3816 |
'booking_date': '2020-08-01',
|
|
3817 |
}
|
|
3818 |
with mock.patch('passerelle.contrib.toulouse_axel.models.ToulouseAxel.get_child_activities', return_value=activities):
|
|
3819 |
with mock.patch('passerelle.contrib.toulouse_axel.schemas.reservation_annuelle') as operation:
|
|
3820 |
operation.return_value = schemas.OperationResult(json_response={}, xml_request='', xml_response='')
|
|
3821 |
app.post_json('/toulouse-axel/test/clae_booking_annual?NameID=yyy', params=annual_booking_params)
|
3815 |
3822 |
payload = operation.call_args_list[0][0][1]['PORTAIL']['DUI']
|
3816 |
|
assert payload['ENFANT'][0]['ACTIVITE'][0]['PERIODE'][0]['DATEDEBUT'] == '2020-08-09'
|
|
3823 |
assert payload['ENFANT'][0]['ACTIVITE'][0]['PERIODE'][0]['DATEDEBUT'] == '2020-08-01'
|
3817 |
3824 |
assert payload['ENFANT'][0]['ACTIVITE'][0]['PERIODE'][0]['DATEDFIN'] == '2021-07-31'
|
3818 |
3825 |
|
3819 |
3826 |
|
3820 |
|
-
|