From: Tomas Babej Date: Wed, 31 Dec 2014 18:26:47 +0000 (+0100) Subject: tests: Check that the priority is removed when assigned None X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/b06aa6d82521befcb2871ec585e2c13f1b54ee2a?ds=inline;hp=--cc tests: Check that the priority is removed when assigned None --- b06aa6d82521befcb2871ec585e2c13f1b54ee2a diff --git a/tasklib/tests.py b/tasklib/tests.py index 76a9514..fe37e01 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -240,6 +240,22 @@ class TaskTest(TasklibTest): 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):