示例#1
0
 def test_save_task_get_task(self):
     """Saves a modified task and retrieves it from the db."""
     store = TodoStore(self.db)
     task = store.new_task()
     task.title = "This is the title."
     store.save_task(task)
     task_copy = store.get_task(task.doc_id)
     self.assertEqual(task.title, task_copy.title)
示例#2
0
 def test_get_all_tags(self):
     store = TodoStore(self.db)
     store.initialize_db()
     tags = ['foo', 'bar', 'bam']
     task = store.new_task(tags=tags)
     self.assertEqual(sorted(tags), sorted(store.get_all_tags()))
     tags = ['foo', 'sball']
     task.tags = tags
     store.save_task(task)
     self.assertEqual(sorted(tags), sorted(store.get_all_tags()))