def test_update(self): new_type = 'different type' self.event.add_update_action('type', 'set', new_type) self.event.update() self.event.refresh() retrieved_obj = EventDataModel.get(self.event_id, self.start_time) self.assertEqual(retrieved_obj, self.event) self.assertEqual(retrieved_obj.type, new_type)
def test_delete(self): self.assertTrue(self.event.exists()) self.event.delete() with self.assertRaises(EventDataModel.DoesNotExist): EventDataModel.get(self.event_id, self.start_time)
def test_create_and_retrieve(self): self.assertTrue(self.event.exists()) retrieved_obj = EventDataModel.get(self.event_id, self.start_time) self.event.refresh() self.assertEqual(retrieved_obj, self.event)