]> git.madduck.net Git - etc/taskwarrior.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Tests: Add tests for setting and removing due date
authorTomas Babej <tomasbabej@gmail.com>
Thu, 1 Jan 2015 19:11:57 +0000 (20:11 +0100)
committerTomas Babej <tomasbabej@gmail.com>
Thu, 1 Jan 2015 19:23:49 +0000 (20:23 +0100)
tasklib/tests.py

index fe37e01d55d0d3efc3c0171d2aec97fc653135cd..b87868f4125cde5e0eb7a96aaa7b68fb9a30ba6a 100644 (file)
@@ -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):