Example #1
0
 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')
Example #2
0
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
    )
Example #3
0
def uncompleted_tasks():
    return render_template(
        'tasks_completed.html',
        uncompleted_tasks=Task.get_tasks(current_user.get_id(),
                                         status='uncompleted')
    )
Example #4
0
def week_tasks():
    week_tasks = Task.get_tasks(current_user.get_id())
    return render_template(
        'tasks_week.html',
        week_tasks=week_tasks
    )