def __init__(self, package, version):
        """Construct a new requirement.

        :param package: the package name.
        :param version: a semver compatible version specification.
        """
        self.package = package
        self.version = version
        if self.version and not re.match(r"[<=>~]", version[:2]):
            self.version = "=={}".format(self.version)
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}
        )