def test_get_all_tasks(self): """Should get all the tasks for the given username""" tasks = Task.get_tasks(USER['username']) self.assertEqual(len(tasks), len(TASK_FIXTURES)) for task in tasks: self.assertTrue(task['title'] in TASK_FIXTURES) self.assertEqual(task['status'], 'uncompleted')
def day_tasks(): day_tasks = {} tasks = Task.get_tasks(current_user.get_id()) for task in tasks: day_tasks.setdefault(task['timestamp'], []).append(task) return render_template( 'tasks_day.html', day_tasks=day_tasks )
def uncompleted_tasks(): return render_template( 'tasks_completed.html', uncompleted_tasks=Task.get_tasks(current_user.get_id(), status='uncompleted') )
def week_tasks(): week_tasks = Task.get_tasks(current_user.get_id()) return render_template( 'tasks_week.html', week_tasks=week_tasks )