caluire-axel: add activity_id in set_agenda changes result (#67280)
This commit is contained in:
parent
41dd355721
commit
a02ffc773d
|
@ -908,7 +908,13 @@ class CaluireAxel(BaseResource):
|
|||
updated = sorted(updated, key=itemgetter(0, 1, 2))
|
||||
updated = [u for b, a, d, u in updated]
|
||||
updated = [
|
||||
{'booked': u['booked'], 'activity_label': u['activity_label'], 'day': u['day']} for u in updated
|
||||
{
|
||||
'booked': u['booked'],
|
||||
'activity_id': u['activity_id'],
|
||||
'activity_label': u['activity_label'],
|
||||
'day': u['day'],
|
||||
}
|
||||
for u in updated
|
||||
]
|
||||
|
||||
return {
|
||||
|
|
|
@ -2028,12 +2028,12 @@ def test_set_agenda_endpoint_multi(app, resource, family_data, booking_params):
|
|||
assert resp.json['updated'] is True
|
||||
assert resp.json['count'] == 6
|
||||
assert resp.json['changes'] == [
|
||||
{'activity_label': 'Matin', 'day': '2020-09-07', 'booked': True},
|
||||
{'activity_label': 'Matin', 'day': '2020-09-08', 'booked': True},
|
||||
{'activity_label': 'Cantine', 'day': '2020-09-07', 'booked': True},
|
||||
{'activity_label': 'Matin', 'day': '2020-09-10', 'booked': False},
|
||||
{'activity_label': 'Matin', 'day': '2020-09-11', 'booked': False},
|
||||
{'activity_label': 'Cantine', 'day': '2020-09-11', 'booked': False},
|
||||
{'activity_id': 'ACCMAT', 'activity_label': 'Matin', 'day': '2020-09-07', 'booked': True},
|
||||
{'activity_id': 'ACCMAT', 'activity_label': 'Matin', 'day': '2020-09-08', 'booked': True},
|
||||
{'activity_id': 'ECOLELEM', 'activity_label': 'Cantine', 'day': '2020-09-07', 'booked': True},
|
||||
{'activity_id': 'ACCMAT', 'activity_label': 'Matin', 'day': '2020-09-10', 'booked': False},
|
||||
{'activity_id': 'ACCMAT', 'activity_label': 'Matin', 'day': '2020-09-11', 'booked': False},
|
||||
{'activity_id': 'ECOLELEM', 'activity_label': 'Cantine', 'day': '2020-09-11', 'booked': False},
|
||||
]
|
||||
|
||||
assert len(operation.call_args_list) == 2
|
||||
|
|
Loading…
Reference in New Issue