def getTaskWrittenAndRead(self, targetId): # pylint: disable=W0621 return [task for task in self.tasksWrittenAndRead if task.id() == targetId][0]
def collectIds(tasks): for task in tasks: tasksById[task.id()] = task collectIds(task.children())
def getTaskWrittenAndRead(self, targetId): # pylint: disable=W0621 return [ task for task in self.tasksWrittenAndRead if task.id() == targetId ][0]
def assertPropertyWrittenAndRead(self, task, property): taskWrittenAndRead = self.getTaskWrittenAndRead(task.id()) self.assertEqual(getattr(task, property), getattr(taskWrittenAndRead, property))
def assertAttributeWrittenAndRead(self, task, attribute): taskWrittenAndRead = self.getTaskWrittenAndRead(task.id()) self.assertEqual(getattr(task, attribute)(), getattr(taskWrittenAndRead, attribute)())
def getTaskWrittenAndRead(self, id): return [task for task in self.tasksWrittenAndRead if task.id() == id][0]
def assertContainedDomainObjectsWrittenAndRead(self, task, attribute): taskWrittenAndRead = self.getTaskWrittenAndRead(task.id()) self.assertEqual([obj.id() for obj in getattr(task, attribute)()], [obj.id() for obj in getattr(taskWrittenAndRead, attribute)()])