Commit f707ab53 authored by Jérome Perrin's avatar Jérome Perrin

test of a task with no price currency and no price on the task line


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30055 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cccfe0b5
......@@ -67,6 +67,20 @@ class TestTaskMixin:
stepTic \
stepSetTaskReport '
default_task_no_price_sequence = '\
stepLogin \
stepCreateOrganisation \
stepCreateOrganisation \
stepCreateResource \
stepCreateProject \
stepCreateRequirement \
stepCreateSimpleTask \
stepFillTaskWithData \
stepConfirmTask \
stepTic \
stepSetTaskReport '
default_task_sequence_two_lines = '\
stepLogin \
stepCreateOrganisation \
......@@ -245,9 +259,7 @@ class TestTaskMixin:
def stepSetTaskPriceCurrency(self, sequence, **kw) :
"""Set the price currency of the task.
This step is not necessary.
TODO : - include a test without this step.
- include a test with this step late.
TODO : include a test with this step late.
"""
currency = sequence.get('currency')
task = sequence.get('task')
......@@ -443,6 +455,14 @@ class TestTaskMixin:
task_report = sequence.get('task_report')
self.assertEqual(task_report.getCausalityState(), 'solved')
def stepVerifyTaskReportNoPrice(self, sequence=None,
sequence_list=None, **kw):
task_report = sequence.get('task_report')
self.assertEqual(None, task_report.getPriceCurrency())
self.assertEqual(1, len(task_report.getMovementList()))
task_report_line = task_report.getMovementList()[0]
self.assertEqual(None, task_report_line.getPrice())
def modifyState(self, object_name, transition_name, sequence=None,
sequence_list=None):
object_value = sequence.get(object_name)
......@@ -549,6 +569,24 @@ class TestTask(TestTaskMixin, ERP5TypeTestCase):
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_01_testTaskNoPrice(self, quiet=0, run=run_all_test):
"""
Test creation of task and (automatic) task_report when no price is
defined on the task
"""
if not run: return
self.default_price = None
sequence_list = SequenceList()
sequence_string = self.default_task_no_price_sequence + '\
stepVerifyGeneratedByBuilderTaskReport \
stepVerifyTaskReportNoPrice \
stepStartTaskReport \
stepFinishTaskReport \
stepCloseTaskReport \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_02_testMultipleLineTaskBasicUseCase(self, quiet=0, run=run_all_test):
"""
......
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