From b06aa6d82521befcb2871ec585e2c13f1b54ee2a Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Wed, 31 Dec 2014 19:26:47 +0100 Subject: [PATCH 1/1] tests: Check that the priority is removed when assigned None --- tasklib/tests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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): -- 2.39.5