Пример #1
0
    def _create_projects_hierarchy(self, hierarchy_size=3):
        """Create a project hierarchy with specified size.

        :param hierarchy_size: the desired hierarchy size, default is 3.

        :returns: a list of the projects in the created hierarchy.

        """
        ref = self.new_ref()
        project_id = ref['id']
        projects = [ref]

        for i in range(1, hierarchy_size):
            new_ref = self.new_ref()
            new_ref['parent_id'] = project_id
            projects.append(new_ref)
            project_id = new_ref['id']

        return projects
    def _create_projects_hierarchy(self, hierarchy_size=3):
        """Create a project hierarchy with specified size.

        :param hierarchy_size: the desired hierarchy size, default is 3.

        :returns: a list of the projects in the created hierarchy.

        """
        ref = self.new_ref()
        project_id = ref['id']
        projects = [ref]

        for i in range(1, hierarchy_size):
            new_ref = self.new_ref()
            new_ref['parent_id'] = project_id
            projects.append(new_ref)
            project_id = new_ref['id']

        return projects