Commit 2e10dc06 authored by Romain Courteaud's avatar Romain Courteaud

Check that description and source project are copied on Task Report.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17095 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2285e9ad
...@@ -42,7 +42,9 @@ class TestTaskMixin: ...@@ -42,7 +42,9 @@ class TestTaskMixin:
default_price = 555.88888888 default_price = 555.88888888
organisation_portal_type = 'Organisation' organisation_portal_type = 'Organisation'
resource_portal_type = 'Service' resource_portal_type = 'Service'
project_portal_type = 'Project'
task_portal_type = 'Task' task_portal_type = 'Task'
task_description = 'Task Description %s'
task_line_portal_type = 'Task Line' task_line_portal_type = 'Task Line'
task_report_portal_type = 'Task Report' task_report_portal_type = 'Task Report'
task_report_line_portal_type = 'Task Report Line' task_report_line_portal_type = 'Task Report Line'
...@@ -52,6 +54,7 @@ class TestTaskMixin: ...@@ -52,6 +54,7 @@ class TestTaskMixin:
default_task_sequence = 'stepCreateOrganisation \ default_task_sequence = 'stepCreateOrganisation \
stepCreateOrganisation \ stepCreateOrganisation \
stepCreateResource \ stepCreateResource \
stepCreateProject \
stepCreateSimpleTask \ stepCreateSimpleTask \
stepFillTaskWithData \ stepFillTaskWithData \
stepConfirmTask \ stepConfirmTask \
...@@ -62,6 +65,7 @@ class TestTaskMixin: ...@@ -62,6 +65,7 @@ class TestTaskMixin:
stepCreateOrganisation \ stepCreateOrganisation \
stepCreateResource \ stepCreateResource \
stepCreateResource \ stepCreateResource \
stepCreateProject \
stepCreateSimpleTask \ stepCreateSimpleTask \
stepFillTaskWithData \ stepFillTaskWithData \
stepCreateTaskLine \ stepCreateTaskLine \
...@@ -106,6 +110,18 @@ class TestTaskMixin: ...@@ -106,6 +110,18 @@ class TestTaskMixin:
resource_list.append(resource) resource_list.append(resource)
sequence.edit(resource_list=resource_list) sequence.edit(resource_list=resource_list)
def stepCreateProject(self,sequence=None, sequence_list=None, \
**kw):
"""
Create a project
"""
portal = self.getPortal()
module = portal.getDefaultModule(self.project_portal_type)
obj = module.newContent(
portal_type=self.project_portal_type,
title = 'Project',
)
sequence.edit(project=obj)
def stepCreateOrganisation(self, sequence=None, sequence_list=None, **kw): def stepCreateOrganisation(self, sequence=None, sequence_list=None, **kw):
""" """
...@@ -141,6 +157,7 @@ class TestTaskMixin: ...@@ -141,6 +157,7 @@ class TestTaskMixin:
Fill created task with some necessary data. Fill created task with some necessary data.
""" """
task = sequence.get('task') task = sequence.get('task')
project = sequence.get('project')
resource = sequence.get('resource_list')[0] resource = sequence.get('resource_list')[0]
organisation_list = sequence.get('organisation_list') organisation_list = sequence.get('organisation_list')
organisation1 = organisation_list[0] organisation1 = organisation_list[0]
...@@ -149,6 +166,8 @@ class TestTaskMixin: ...@@ -149,6 +166,8 @@ class TestTaskMixin:
source_section_value=organisation1, source_section_value=organisation1,
destination_value=organisation1, destination_value=organisation1,
destination_section_value=organisation2, destination_section_value=organisation2,
source_project_value=project,
description=self.task_description % task.getId(),
task_line_resource_value = resource, task_line_resource_value = resource,
task_line_quantity = self.default_quantity, task_line_quantity = self.default_quantity,
task_line_price = self.default_price, task_line_price = self.default_price,
...@@ -213,6 +232,7 @@ class TestTaskMixin: ...@@ -213,6 +232,7 @@ class TestTaskMixin:
self.assertEquals('confirmed', task_report.getSimulationState()) self.assertEquals('confirmed', task_report.getSimulationState())
self.assertEquals(task.getSource(), task_report.getSource()) self.assertEquals(task.getSource(), task_report.getSource())
self.assertEquals(task.getSourceSection(), task_report.getSourceSection()) self.assertEquals(task.getSourceSection(), task_report.getSourceSection())
self.assertEquals(task.getSourceProject(), task_report.getSourceProject())
self.assertEquals(task.getDestination(), task_report.getDestination()) self.assertEquals(task.getDestination(), task_report.getDestination())
self.assertEquals(task.getDestinationSection(), self.assertEquals(task.getDestinationSection(),
task_report.getDestinationSection()) task_report.getDestinationSection())
...@@ -220,6 +240,8 @@ class TestTaskMixin: ...@@ -220,6 +240,8 @@ class TestTaskMixin:
task_report.getDestinationDecision()) task_report.getDestinationDecision())
self.assertEquals(task.getTitle(), self.assertEquals(task.getTitle(),
task_report.getTitle()) task_report.getTitle())
self.assertEquals(task.getDescription(),
task_report.getDescription())
self.assertEquals(task.getPredecessor(), task_report.getPredecessor()) self.assertEquals(task.getPredecessor(), task_report.getPredecessor())
self.assertEquals(task.getDescription(), task_report.getDescription()) self.assertEquals(task.getDescription(), task_report.getDescription())
self.assertEquals(len(task_report.contentValues()), 1) self.assertEquals(len(task_report.contentValues()), 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment