def search(self, regex):
        try:
            spec = {'$or': [{'data.content'    : {'$regex': regex, '$options': 'im'}},
                            {'data.description': {'$regex': regex, '$options': 'im'}}]}
            fields = {'_id': 0}
            cur = self.db.docs.find(spec, fields)
        except Exception as e:
            raise DatabaseException(e)
        return [Document(**row) for row in cur]
def setUp(self):
        super().setUp()

        self.project1 = self.env["project.project"].create({"name": "Project 1"})
        self.task1 = self.env["project.task"].create(
            {"name": "name1", "project_id": self.project1.id}
        )
        self.subtask1 = self.env["project.task"].create(
            {"name": "2", "project_id": self.project1.id, "parent_id": self.task1.id}
        )
        self.subtask2 = self.env["project.task"].create(
            {"name": "3", "project_id": self.project1.id, "parent_id": self.task1.id}
        )