예제 #1
0
 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'])
예제 #2
0
 def test_tags(self):
     """Tags property returns a list."""
     task = Task(self.document)
     self.assertEqual([], task.tags)
예제 #3
0
 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'])
예제 #4
0
 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'])
예제 #5
0
 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)
예제 #6
0
 def test_task(self):
     """Initializing a task."""
     task = Task(self.document)
     self.assertEqual("", task.title)
     self.assertEqual([], task.tags)
     self.assertEqual(False, task.done)