0001-vivaticket-accept-quantity-parameter-as-decimal-stri.patch
passerelle/apps/vivaticket/models.py | ||
---|---|---|
111 | 111 |
"description": "room id", |
112 | 112 |
"type": "string", |
113 | 113 |
}, |
114 |
"quantity": { |
|
115 |
"description": "quantity", |
|
116 |
"type": "integer", |
|
117 |
}, |
|
114 |
"quantity": {"description": "quantity", "type": "string", "pattern": "^[0-9]+$"}, |
|
118 | 115 |
"booking_comment": { |
119 | 116 |
"description": "booking comment", |
120 | 117 |
"type": "string", |
... | ... | |
279 | 276 |
'eventCategoryCode': post_data['event'], |
280 | 277 |
'roomCode': post_data['room'], |
281 | 278 |
'themeCode': post_data['theme'], |
282 |
'quantity': post_data['quantity'],
|
|
279 |
'quantity': int(post_data['quantity']),
|
|
283 | 280 |
'startDateTime': post_data['start_datetime'], |
284 | 281 |
'endDateTime': post_data['end_datetime'], |
285 | 282 |
'comment': post_data.get('room_comment', ''), |
tests/test_vivaticket.py | ||
---|---|---|
355 | 355 |
payload['theme'] = '001' |
356 | 356 |
payload['room'] = 'v001' |
357 | 357 |
payload['school_level'] = '01' |
358 |
payload['quantity'] = 1
|
|
358 |
payload['quantity'] = '01'
|
|
359 | 359 |
payload['booking_comment'] = 'Booking comment' |
360 | 360 |
payload['room_comment'] = 'Room comment' |
361 | 361 |
payload['form_url'] = "http://mysite.com/form/id/" |
... | ... | |
376 | 376 |
assert mocked_post.call_args[1]['json']['Booking']['endDateTime'] == '2019-01-15T11:00' |
377 | 377 |
assert mocked_post.call_args[1]['json']['Booking']['comment'] == 'Booking comment' |
378 | 378 |
assert mocked_post.call_args[1]['json']['Booking']['roomList'][0]['comment'] == 'Room comment' |
379 |
assert mocked_post.call_args[1]['json']['Booking']['roomList'][0]['quantity'] == 1 |
|
379 | 380 |
assert mocked_post.call_args[1]['json']['Booking']['roomList'][0]['schoolLevelCode'] == '01' |
380 | 381 |
assert mocked_post.call_args[1]['json']['Booking']['contact'] == {'InternalCode': '0000000273'} |
381 | 382 |
assert mocked_post.call_args[1]['headers'] == {'X-Vivaticket-Form-URL': 'http://mysite.com/form/id/'} |
382 |
- |