Commit de1dca40 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Also check the todo field for the completion date.

parent cad95a5f
......@@ -149,33 +149,42 @@ class TodoBaseTester(unittest.TestCase):
todo = TodoBase.TodoBase("(A) Foo")
todo.set_completed()
today = datetime.date.today().isoformat()
today = datetime.date.today()
today_str = today.isoformat()
self.assertTrue(re.match('^x ' + today + ' Foo', todo.src))
self.assertEquals(todo.fields['completionDate'], today)
self.assertTrue(re.match('^x ' + today_str + ' Foo', todo.src))
def test_set_complete2(self):
todo = TodoBase.TodoBase("2014-06-12 Foo")
todo.set_completed()
today = datetime.date.today().isoformat()
today = datetime.date.today()
today_str = today.isoformat()
self.assertTrue(re.match('^x ' + today + ' 2014-06-12 Foo', todo.src))
self.assertEquals(todo.fields['completionDate'], today)
self.assertTrue(re.match('^x ' + today_str + ' 2014-06-12 Foo', \
todo.src))
def test_set_complete3(self):
todo = TodoBase.TodoBase("Foo")
todo.set_completed()
today = datetime.date.today().isoformat()
today = datetime.date.today()
today_str = today.isoformat()
self.assertTrue(re.match('^x ' + today + ' Foo', todo.src))
self.assertEquals(todo.fields['completionDate'], today)
self.assertTrue(re.match('^x ' + today_str + ' Foo', todo.src))
def test_set_complete4(self):
todo = TodoBase.TodoBase("(A) 2014-06-12 Foo")
todo.set_completed()
today = datetime.date.today().isoformat()
today = datetime.date.today()
today_str = today.isoformat()
self.assertTrue(re.match('^x ' + today + ' 2014-06-12 Foo', todo.src))
self.assertEquals(todo.fields['completionDate'], today)
self.assertTrue(re.match('^x ' + today_str + ' 2014-06-12 Foo', todo.src))
if __name__ == '__main__':
unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment