def test_delete_story(self): # This test uses mock_data story_id = 1 # Verify that we can look up a story with tasks and events story = stories_api.story_get_simple(story_id) self.assertIsNotNone(story) tasks = tasks_api.task_get_all(story_id=story_id) self.assertEqual(len(tasks), 3) task_ids = [t.id for t in tasks] events = events_api.events_get_all(story_id=story_id) self.assertEqual(len(events), 3) event_ids = [e.id for e in events] # Delete the story stories_api.story_delete(story_id) story = stories_api.story_get_simple(story_id) self.assertIsNone(story) # Verify that the story's tasks were deleted tasks = tasks_api.task_get_all(story_id=story_id) self.assertEqual(len(tasks), 0) for tid in task_ids: task = tasks_api.task_get(task_id=tid) self.assertIsNone(task) # And the events events = events_api.events_get_all(story_id=story_id) self.assertEqual(len(events), 0) for eid in event_ids: event = events_api.event_get(event_id=eid) self.assertIsNone(event)
def delete(self, story_id): """Delete this story. :param story_id: An ID of the story. """ stories_api.story_delete( story_id, current_user=request.current_user_id)
def delete(self, story_id): """Delete this story. :param story_id: An ID of the story. """ stories_api.story_delete(story_id, current_user=request.current_user_id)
def delete(self, story_id): """Delete this story. This command is only available to Admin users. Example:: curl 'https://my.example.org/api/v1/stories/5' -X DELETE \\ -H 'Authorization: Bearer MY_ACCESS_TOKEN' :param story_id: An ID of the story. """ stories_api.story_delete(story_id, current_user=request.current_user_id)
def delete(self, story_id): """Delete this story. This command is only available to Admin users. Example:: curl 'https://my.example.org/api/v1/stories/5' -X DELETE \\ -H 'Authorization: Bearer MY_ACCESS_TOKEN' :param story_id: An ID of the story. """ stories_api.story_delete( story_id, current_user=request.current_user_id)
def delete(self, story_id): """Delete this story. :param story_id: An ID of the story. """ stories_api.story_delete(story_id)