Example #1
0
def create_project_with_tasks(workflow_slug,
                              description,
                              priority,
                              task_class,
                              project_data,
                              review_document_url,
                              workflow_version_slug=None):

    # Allow backwards compatibility with calls that pass in a version slug in
    # the 'workflow_slug' variable.
    # TODO(dhaas): be less backward-compatible?
    if workflow_version_slug is None:
        try:
            workflow_version = WorkflowVersion.objects.get(slug=workflow_slug)
        except WorkflowVersion.MultipleObjectsReturned:
            raise ValueError('No workflow slug passed, and version slug {} is '
                             'not unique.'.format(workflow_slug))
    else:
        workflow_version = WorkflowVersion.objects.get(
            slug=workflow_version_slug,
            workflow__slug=workflow_slug)

    project = Project.objects.create(workflow_version=workflow_version,
                                     short_description=description,
                                     priority=priority,
                                     project_data=project_data,
                                     task_class=task_class,
                                     review_document_url=review_document_url)

    create_project_slack_group(project)
    create_project_google_folder(project)

    create_subsequent_tasks(project)
    return project
Example #2
0
 def test_create_project_google_folder(self):
     project = self.projects['empty_project']
     # TODO(jrbotros): add additional functionality to google mock
     project_folder = create_project_google_folder(project)
     self.assertEquals(project_folder['id'], 1)
     self.assertEquals(project.team_messages_url,
                       'http://a.google.com/link')
Example #3
0
 def test_create_project_google_folder(self):
     project = self.projects['empty_project']
     # TODO(jrbotros): add additional functionality to google mock
     project_folder = create_project_google_folder(project)
     self.assertEquals(project_folder['id'], 1)
     self.assertEquals(
         project.team_messages_url, 'http://a.google.com/link')
Example #4
0
def create_project_with_tasks(workflow_slug, workflow_version_slug,
                              description, priority, task_class, project_data):

    workflow_version = WorkflowVersion.objects.get(
        slug=workflow_version_slug, workflow__slug=workflow_slug)

    project = Project.objects.create(workflow_version=workflow_version,
                                     short_description=description,
                                     priority=priority,
                                     project_data=project_data,
                                     task_class=task_class)

    create_project_google_folder(project)
    create_project_slack_group(project)
    create_subsequent_tasks(project)
    return project
Example #5
0
def create_project_with_tasks(workflow_slug,
                              description,
                              priority,
                              task_class,
                              project_data,
                              review_document_url):

    project = Project.objects.create(workflow_slug=workflow_slug,
                                     short_description=description,
                                     priority=priority,
                                     project_data=project_data,
                                     task_class=task_class,
                                     review_document_url=review_document_url)

    create_project_slack_group(project)
    create_project_google_folder(project)

    create_subsequent_tasks(project)
    return project
Example #6
0
def create_project_with_tasks(workflow_slug,
                              workflow_version_slug,
                              description,
                              priority,
                              task_class,
                              project_data):

    workflow_version = WorkflowVersion.objects.get(
        slug=workflow_version_slug,
        workflow__slug=workflow_slug)

    project = Project.objects.create(workflow_version=workflow_version,
                                     short_description=description,
                                     priority=priority,
                                     project_data=project_data,
                                     task_class=task_class)

    create_project_slack_group(project)
    create_project_google_folder(project)

    create_subsequent_tasks(project)
    return project
Example #7
0
 def test_create_project_google_folder(self):
     project = self.projects['empty_project']
     # TODO(jrbotros): add additional functionality to google mock
     project_folder = create_project_google_folder(project)
     self.assertEquals(project_folder['id'], 1)