From ba60d886adb456411b1cbce0a9fb4c61e64cb52e Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 1 Jan 2015 20:11:57 +0100 Subject: [PATCH] Tests: Add tests for setting and removing due date --- tasklib/tests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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): -- 2.39.5