示例#1
0
    def setUp(self):
        super(MilestonesTest, self).setUp()

        self.milestone_01 = {
            'name': u'test_milestone',
            'branch_id': 1
        }

        self.branch_01 = {
            'name': u'test_branch',
            'project_id': 1
        }

        self.project_01 = {
            'name': u'TestProject',
            'description': u'TestDescription'
        }

        projects.project_create(self.project_01)
        branches.branch_create(self.branch_01)
示例#2
0
    def post(self, branch):
        """Create a new branch.

        :param branch: A branch within the request body.
        """

        branch_dict = branch.as_dict()

        # we can't create expired branch
        if branch.expiration_date or branch.expired:
            abort(400, _("Can't create expired branch."))

        result = branches_api.branch_create(branch_dict)
        return wmodels.Branch.from_db_model(result)
示例#3
0
    def post(self, branch):
        """Create a new branch.

        :param branch: A branch within the request body.
        """

        branch_dict = branch.as_dict()

        # we can't create expired branch
        if branch.expiration_date or branch.expired:
            abort(400, _("Can't create expired branch."))

        result = branches_api.branch_create(branch_dict)
        return wmodels.Branch.from_db_model(result)
示例#4
0
def project_create(values):
    # Create project and 'master' branch for him
    project = api_base.entity_create(models.Project, values)
    master_branch = MasterBranchHelper(project["id"])
    branches_api.branch_create(master_branch.as_dict())
    return project
示例#5
0
def project_create(values):
    # Create project and 'master' branch for him
    project = api_base.entity_create(models.Project, values)
    master_branch = MasterBranchHelper(project["id"])
    branches_api.branch_create(master_branch.as_dict())
    return project