1426 |
1426 |
assert resp_cancel.json['err'] == 0
|
1427 |
1427 |
assert Booking.objects.filter(cancellation_datetime__isnull=False).count() == 2
|
1428 |
1428 |
|
|
1429 |
|
|
1430 |
def test_booking_api_meeting_fillslots_wrong_slot(app, user):
|
|
1431 |
agenda = Agenda.objects.create(label='Foo', kind='meetings')
|
|
1432 |
app.authorization = ('Basic', ('john.doe', 'password'))
|
|
1433 |
|
1429 |
1434 |
impossible_slots = ['1:2017-05-22-1130', '2:2017-05-22-1100']
|
1430 |
|
resp = app.post('/api/agenda/%s/fillslots/' % agenda_id, params={'slots': impossible_slots}, status=400)
|
|
1435 |
resp = app.post('/api/agenda/%s/fillslots/' % agenda.slug, params={'slots': impossible_slots}, status=400)
|
1431 |
1436 |
assert resp.json['err'] == 1
|
1432 |
1437 |
assert resp.json['reason'] == 'all slots must have the same meeting type id (1)' # legacy
|
1433 |
1438 |
assert resp.json['err_class'] == 'all slots must have the same meeting type id (1)'
|
1434 |
1439 |
assert resp.json['err_desc'] == 'all slots must have the same meeting type id (1)'
|
1435 |
1440 |
|
1436 |
1441 |
unknown_slots = ['0:2017-05-22-1130']
|
1437 |
|
resp = app.post('/api/agenda/%s/fillslots/' % agenda_id, params={'slots': unknown_slots}, status=400)
|
|
1442 |
resp = app.post('/api/agenda/%s/fillslots/' % agenda.slug, params={'slots': unknown_slots}, status=400)
|
1438 |
1443 |
assert resp.json['err'] == 1
|
1439 |
1444 |
assert resp.json['reason'] == 'invalid meeting type id: 0' # legacy
|
1440 |
1445 |
assert resp.json['err_class'] == 'invalid meeting type id: 0'
|
1441 |
1446 |
assert resp.json['err_desc'] == 'invalid meeting type id: 0'
|
1442 |
1447 |
unknown_slots = ['foobar:2017-05-22-1130']
|
1443 |
|
resp = app.post('/api/agenda/%s/fillslots/' % agenda_id, params={'slots': unknown_slots}, status=400)
|
|
1448 |
resp = app.post('/api/agenda/%s/fillslots/' % agenda.slug, params={'slots': unknown_slots}, status=400)
|
1444 |
1449 |
assert resp.json['err'] == 1
|
1445 |
1450 |
assert resp.json['reason'] == 'invalid meeting type id: foobar' # legacy
|
1446 |
1451 |
assert resp.json['err_class'] == 'invalid meeting type id: foobar'
|
1447 |
1452 |
assert resp.json['err_desc'] == 'invalid meeting type id: foobar'
|
1448 |
1453 |
|
|
1454 |
badformat_slots = ['foo:2020-10-28-14h00']
|
|
1455 |
resp = app.post('/api/agenda/%s/fillslots/' % agenda.slug, params={'slots': badformat_slots}, status=400)
|
|
1456 |
assert resp.json['err'] == 1
|
|
1457 |
assert resp.json['reason'] == 'bad datetime format: 2020-10-28-14h00' # legacy
|
|
1458 |
assert resp.json['err_class'] == 'bad datetime format: 2020-10-28-14h00'
|
|
1459 |
assert resp.json['err_desc'] == 'bad datetime format: 2020-10-28-14h00'
|
|
1460 |
|
1449 |
1461 |
|
1450 |
1462 |
def test_booking_api_meeting_across_daylight_saving_time(app, meetings_agenda, user):
|
1451 |
1463 |
meetings_agenda.maximal_booking_delay = 365
|
1452 |
|
-
|