Commit acced39d authored by Fabien Morin's avatar Fabien Morin

add a test to check consistency.

Modify existing tests to be consitent


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27393 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1d979fe5
......@@ -371,7 +371,10 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
paysheet.edit(title='test 1',
specialise_value=sequence.get('model'),
source_section_value=sequence.get('employee'),
destination_section_value=sequence.get('employer'))
destination_section_value=sequence.get('employer'),
resource_value=sequence.get('price_currency'),
start_date=DateTime(),
stop_date=DateTime()+1)
sequence.edit(paysheet = paysheet)
def createPaysheetLine(self, document, **kw):
......@@ -906,6 +909,18 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
else:
self.fail("Unknown service for line %s" % paysheet_line.getTitle())
def stepCheckPaysheetConsistency(self, sequence=None, **kw):
paysheet = sequence.get('paysheet')
self.assertEquals([], paysheet.checkConsistency())
def stepCheckModelConsistency(self, sequence=None, **kw):
model = sequence.get('model')
self.assertEquals([], model.checkConsistency())
def stepCheckServiceConsistency(self, sequence=None, **kw):
service = sequence.get('urssaf_payroll_service')
self.assertEquals([], service.checkConsistency())
class TestNewPayroll(TestNewPayrollMixin):
BUSINESS_PATH_CREATION_SEQUENCE_STRING = """
......@@ -921,6 +936,7 @@ class TestNewPayroll(TestNewPayrollMixin):
CreateLabourPayrollService
CreateEmployer
CreateEmployee
CreatePriceCurrency
CreateBasicModel
ModelCreateUrssafModelLine
UrssafModelLineCreateMovements
......@@ -992,6 +1008,20 @@ class TestNewPayroll(TestNewPayrollMixin):
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_checkConsistency(self):
'''
minimal test for checkConsistency on a Pay Sheet Transaction and it's
subdocuments (may have to be updated when we'll add more constraints).
'''
sequence_list = SequenceList()
sequence_string = self.COMMON_BASIC_DOCUMENT_CREATION_SEQUENCE_STRING + """
CheckPaysheetConsistency
CheckModelConsistency
CheckServiceConsistency
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_basicPaySheetCalculation(self):
'''
test applyTransformation method. It should create new movements
......
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