def set_tags(self): """Setting the tags property changes the underlying content.""" task = Task(self.document) task.tags = ["foo", "bar"] self.assertEqual(["foo", "bar"], task._document.content['tags'])
def test_tags(self): """Tags property returns a list.""" task = Task(self.document) self.assertEqual([], task.tags)
def test_set_done(self): """Changing the done property changes the underlying content.""" task = Task(self.document) self.assertEqual(False, task._document.content['done']) task.done = True self.assertEqual(True, task._document.content['done'])
def test_set_title(self): """Changing the title is persistent.""" task = Task(self.document) title = "new task" task.title = title self.assertEqual(title, task._document.content['title'])
def test_task_id(self): """Task id is set to document id.""" task = Task(self.document) self.assertEqual(self.document.doc_id, task.task_id)
def test_task(self): """Initializing a task.""" task = Task(self.document) self.assertEqual("", task.title) self.assertEqual([], task.tags) self.assertEqual(False, task.done)