def test_update_task(self): done_status = tasks_service.get_done_status() tasks_service.update_task(self.task.id, {"task_status_id": done_status["id"]}) self.assertEquals(str(self.task.task_status_id), done_status["id"]) self.assertIsNotNone(self.task.end_date) self.assertLess(self.task.end_date, datetime.datetime.now())
def test_get_todos(self): task_id = self.task.id shot_task_id = self.shot_task.id path = "data/user/tasks/" tasks = self.get(path) self.assertEquals(len(tasks), 0) self.assign_user(task_id) self.assign_user(shot_task_id) path = "data/user/tasks/" tasks = self.get(path) self.assertEquals(len(tasks), 2) tasks_service.update_task( shot_task_id, {"task_status_id": tasks_service.get_done_status()["id"]}) self.assign_user(task_id) self.assign_user(shot_task_id) path = "data/user/tasks/" tasks = self.get(path) self.assertEquals(len(tasks), 1)
def test_get_done_tasks_for_person(self): self.task_id = self.task.id tasks = self.get("/data/persons/%s/done-tasks" % self.person.id) self.assertEqual(len(tasks), 0) done_status = tasks_service.get_done_status() tasks_service.update_task(self.task_id, {"task_status_id": done_status["id"]}) tasks = self.get("/data/persons/%s/done-tasks" % self.person.id) self.assertEquals(len(tasks), 1)
def test_get_done_tasks_for_person(self): projects = [self.project.serialize()] tasks = tasks_service.get_person_done_tasks(self.user.id, projects) self.assertEqual(len(tasks), 0) tasks_service.assign_task(self.task.id, self.user.id) tasks = tasks_service.get_person_done_tasks(self.user.id, projects) self.assertEqual(len(tasks), 0) done_status = tasks_service.get_done_status() tasks_service.update_task(self.task.id, {"task_status_id": done_status["id"]}) tasks = tasks_service.get_person_done_tasks(self.user.id, projects) self.assertEqual(len(tasks), 1)
def test_get_done_tasks(self): task_id = self.task.id path = "data/user/done-tasks/" tasks = self.get(path) self.assertEquals(len(tasks), 0) self.assign_user(task_id) path = "data/user/done-tasks/" tasks = self.get(path) self.assertEquals(len(tasks), 0) done_status = tasks_service.get_done_status() tasks_service.update_task(task_id, {"task_status_id": done_status["id"]}) path = "data/user/done-tasks/" tasks = self.get(path) self.assertEquals(len(tasks), 1)
def test_get_done_status(self): task_status = tasks_service.get_done_status() self.assertEqual(task_status["name"], "Done")