]> git.madduck.net Git - etc/taskwarrior.git/blobdiff - tasklib/tests.py

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: Check that the priority is removed when assigned None
[etc/taskwarrior.git] / tasklib / tests.py
index 76a951430a9fc48d9e26cd07fad2f81dfd4995b2..fe37e01d55d0d3efc3c0171d2aec97fc653135cd 100644 (file)
@@ -240,6 +240,22 @@ class TaskTest(TasklibTest):
         t2 = self.tw.tasks.get(uuid=t1['uuid'])
         self.assertEqual(t1.__hash__(), t2.__hash__())
 
         t2 = self.tw.tasks.get(uuid=t1['uuid'])
         self.assertEqual(t1.__hash__(), t2.__hash__())
 
+    def test_adding_task_with_priority(self):
+        t = Task(self.tw, description="test task", priority="M")
+        t.save()
+
+    def test_removing_priority_with_none(self):
+        t = Task(self.tw, description="test task", priority="L")
+        t.save()
+
+        # Remove the priority mark
+        t['priority'] = None
+        t.save()
+
+        # Assert that priority is not there after saving
+        self.assertEqual(t['priority'], None)
+
+
 class AnnotationTest(TasklibTest):
 
     def setUp(self):
 class AnnotationTest(TasklibTest):
 
     def setUp(self):