From: Tomas Babej Date: Thu, 1 Jan 2015 19:11:57 +0000 (+0100) Subject: Tests: Add tests for setting and removing due date X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/ba60d886adb456411b1cbce0a9fb4c61e64cb52e?ds=inline;hp=4c0d71c0c2a8b190249416b29b310f4afcab755b Tests: Add tests for setting and removing due date --- diff --git a/tasklib/tests.py b/tasklib/tests.py index fe37e01..b87868f 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -1,5 +1,6 @@ # coding=utf-8 +import datetime import shutil import tempfile import unittest @@ -255,6 +256,21 @@ class TaskTest(TasklibTest): # Assert that priority is not there after saving self.assertEqual(t['priority'], None) + def test_adding_task_with_due_time(self): + t = Task(self.tw, description="test task", due=datetime.datetime.now()) + t.save() + + def test_removing_due_time_with_none(self): + t = Task(self.tw, description="test task", due=datetime.datetime.now()) + t.save() + + # Remove the due timestamp + t['due'] = None + t.save() + + # Assert that due timestamp is no longer there + self.assertEqual(t['due'], None) + class AnnotationTest(TasklibTest):