24 |
24 |
def some_data():
|
25 |
25 |
agenda = Agenda(label=u'Foo bar')
|
26 |
26 |
agenda.save()
|
27 |
|
first_date = datetime.datetime.now().replace(hour=17, minute=0, second=0)
|
|
27 |
first_date = datetime.datetime.now().replace(hour=17, minute=0, second=0, microsecond=0)
|
28 |
28 |
first_date += datetime.timedelta(days=1)
|
29 |
29 |
for i in range(3):
|
30 |
30 |
event = Event(start_datetime=first_date + datetime.timedelta(days=i),
|
... | ... | |
33 |
33 |
|
34 |
34 |
agenda2 = Agenda(label=u'Foo bar2')
|
35 |
35 |
agenda2.save()
|
36 |
|
first_date = datetime.datetime.now().replace(hour=20, minute=0, second=0)
|
|
36 |
first_date = datetime.datetime.now().replace(hour=20, minute=0, second=0, microsecond=0)
|
37 |
37 |
first_date += datetime.timedelta(days=1)
|
38 |
38 |
for i in range(2):
|
39 |
39 |
event = Event(start_datetime=first_date + datetime.timedelta(days=i),
|
... | ... | |
196 |
196 |
app.authorization = ('Basic', ('john.doe', 'password'))
|
197 |
197 |
resp = app.post('/api/agenda/%s/fillslot/%s/' % (agenda.slug, event.id))
|
198 |
198 |
Booking.objects.get(id=resp.json['booking_id'])
|
|
199 |
assert resp.json['datetime'] == event.start_datetime.isoformat().replace('+00:00', 'Z')
|
199 |
200 |
assert Booking.objects.count() == 1
|
200 |
201 |
|
201 |
202 |
resp = app.post('/api/agenda/%s/fillslot/%s/' % (agenda.id, event.id))
|
... | ... | |
211 |
212 |
event_id = resp.json['data'][2]['id']
|
212 |
213 |
|
213 |
214 |
app.authorization = ('Basic', ('john.doe', 'password'))
|
214 |
|
app.post('/api/agenda/%s/fillslot/%s/' % (agenda_id, event_id))
|
|
215 |
resp_booking = app.post('/api/agenda/%s/fillslot/%s/' % (agenda_id, event_id))
|
215 |
216 |
assert Booking.objects.count() == 1
|
|
217 |
assert resp_booking.json['datetime'] == Booking.objects.get(
|
|
218 |
id=resp_booking.json['booking_id']).event.start_datetime.isoformat().replace('+00:00', 'Z')
|
216 |
219 |
|
217 |
220 |
resp2 = app.get('/api/agenda/meetings/%s/datetimes/' % meeting_type.id)
|
218 |
221 |
assert len(resp.json['data']) == len(resp2.json['data']) + 1
|
219 |
|
-
|