tests: add check for removing an event
This commit is contained in:
parent
148aa07a06
commit
2efadcab9b
|
@ -180,3 +180,18 @@ def test_event_classes(app, admin_user):
|
|||
resp = app.get('/manage/agendas/%s/' % agenda.id, status=200)
|
||||
assert 'full' in resp.body
|
||||
assert 'overbooking' in resp.body
|
||||
|
||||
def test_delete_event(app, admin_user):
|
||||
agenda = Agenda(label=u'Foo bar')
|
||||
agenda.save()
|
||||
event = Event(start_datetime=datetime.datetime(2016, 2, 15, 17, 0),
|
||||
places=10, agenda=agenda)
|
||||
event.save()
|
||||
|
||||
app = login(app)
|
||||
resp = app.get('/manage/agendas/%s/' % agenda.id, status=200)
|
||||
resp = resp.click(href='/manage/events/%s' % event.id)
|
||||
resp = resp.click('Delete')
|
||||
resp = resp.form.submit()
|
||||
assert resp.location == 'http://localhost:80/manage/agendas/%s/' % agenda.id
|
||||
assert Event.objects.count() == 0
|
||||
|
|
Loading…
Reference in New Issue