Example #1
0
    def test_due_on(self):
        one = TaskList({"title": "one", "id": "one"})
        task_one = Task({
            "title":
            "task1",
            "id":
            "one",
            "due_date": (date.today() - timedelta(days=1)).isoformat()
        })
        one.add_task(task_one)
        self.wl.lists.append(one)

        two = TaskList({"title": "two", "id": "two"})
        task_two = Task({
            "title": "two",
            "id": "two",
            "due_date": (date.today().isoformat())
        })
        two.add_task(task_two)
        self.wl.lists.append(two)

        task_three = Task({
            "title":
            "three",
            "id":
            "three",
            "due_date": (date.today() + timedelta(days=1)).isoformat()
        })
        self.inbox.add_task(task_three)

        self.assertEqual(self.wl.tasks_due_on(date.today()), [task_two])
        self.assertEqual(
            self.wl.tasks_due_on(date.today() + timedelta(days=1)),
            [task_three])
Example #2
0
    def test_lists(self):
        one = TaskList({"title": "one", "id": "one"})
        self.wl.lists.append(one)
        two = TaskList({"title": "one", "id": "two"})
        self.wl.lists.append(two)

        self.assertEqual(self.wl.list_with_title("inbox"), self.inbox)
        self.assertEqual(self.wl.lists_with_title("one"), [one, two])
        self.assertEqual(self.wl.id_for_list("inbox"), "inbox")
Example #3
0
    def test_list_filter(self):
        list_one = TaskList(info={"title": "one", "id": "one"})
        self.wl.lists.append(list_one)

        list_two = TaskList(info={"title": "one", "id": "two"})
        self.wl.lists.append(list_two)

        self.assertEqual(self.wl.list_with_title("inbox"), self.inbox)
        self.assertEqual(self.wl.lists_with_title("one"), [list_one, list_two])

        self.wl.lists.remove(list_one)
        self.wl.lists.remove(list_two)
Example #4
0
 def setUp(self):
     info = {
         "title": "inbox",
         "id": "inbox",
         "created_on": None,
         "updated_on": None
     }
     self.test_list = TaskList(info=info)
Example #5
0
    def setUp(self):
        self.wl = Wunderlist()

        # not calling update_lists, because it sends requests
        inbox_info = {
            "title": "inbox",
            "id": "inbox",
            "created_on": None,
            "updated_on": None
        }
        self.inbox = TaskList(info=inbox_info)
        self.wl.lists.append(self.inbox)