def test_delete_event(self):
        event = Event.objects.get(slug="starts-today-ongoing")
        role1 = Role.objects.create(name='NonInstructor')
        t1 = Task.objects.create(event=event, person=self.spiderman,
                                 role=role1)
        t2 = Task.objects.create(event=event, person=self.ironman,
                                 role=role1)
        t3 = Task.objects.create(event=event, person=self.blackwidow,
                                 role=role1)
        event.task_set = [t1, t2, t3]
        event.save()

        rv = self.client.get(reverse('event_delete', args=[event.pk, ]))
        assert rv.status_code == 302

        with self.assertRaises(Event.DoesNotExist):
            Event.objects.get(slug="starts-today-ongoing")

        for t in [t1, t2, t3]:
            with self.assertRaises(Task.DoesNotExist):
                Task.objects.get(pk=t.pk)
Delete an instance in its cell.
dataset/ETHPy150Open swcarpentry/amy/workshops/test/test_event.py/TestEvent.test_delete_event--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/cells/rpcapi.py/CellsAPI.terminate_instance