[Erp5-report] r27595 - in /erp5/trunk/products/ERP5/tests: testNewPayroll.py testPayroll.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Jun 16 11:18:02 CEST 2009
Author: fabien
Date: Tue Jun 16 11:18:00 2009
New Revision: 27595
URL: http://svn.erp5.org?rev=27595&view=rev
Log:
move and update test_PaySheetTransaction_getMovementList from testPayroll.py to testNewPayroll.py
Modified:
erp5/trunk/products/ERP5/tests/testNewPayroll.py
erp5/trunk/products/ERP5/tests/testPayroll.py
Modified: erp5/trunk/products/ERP5/tests/testNewPayroll.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testNewPayroll.py?rev=27595&r1=27594&r2=27595&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testNewPayroll.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testNewPayroll.py [utf8] Tue Jun 16 11:18:00 2009
@@ -1302,6 +1302,45 @@
self.assertNotEquals(social_insurance, None)
social_insurance.getQuantity(3)
+ def stepCheckPaySheetTransaction_getMovementListReturn(self,
+ sequence=None, **kw):
+ paysheet = sequence.get('paysheet')
+ # when pay sheet has no line, the script returns an empty list
+ self.assertEquals(len(paysheet.PaySheetTransaction_getMovementList()), 0)
+
+ # we add a line, then it is returned in the list
+ line = paysheet.newContent(portal_type='Pay Sheet Line')
+ self.assertEquals(len(paysheet.PaySheetTransaction_getMovementList()), 1)
+
+ # if the line has cells with different tax categories, new properties are
+ # added to this line.
+ urssaf_service = sequence.get('urssaf_service')
+ line.setResourceValue(urssaf_service)
+ line.setVariationCategoryList(['tax_category/employee_share',
+ 'tax_category/employer_share'])
+ cell0 = line.newCell('tax_category/employee_share',
+ portal_type='Pay Sheet Cell', base_id='movement')
+ cell0.setMappedValuePropertyList(['quantity', 'price'])
+ cell0.setVariationCategoryList(('tax_category/employee_share',))
+ cell0.setPrice(2)
+ cell0.setQuantity(3)
+ cell1 = line.newCell('tax_category/employer_share',
+ portal_type='Pay Sheet Cell', base_id='movement')
+ cell1.setMappedValuePropertyList(['quantity', 'price'])
+ cell1.setVariationCategoryList(('tax_category/employer_share',))
+ cell1.setPrice(4)
+ cell1.setQuantity(5)
+
+ movement_list = paysheet.PaySheetTransaction_getMovementList()
+ self.assertEquals(1, len(movement_list))
+ movement = movement_list[0]
+ self.assertEquals(2, movement.employee_share_price)
+ self.assertEquals(3, movement.employee_share_quantity)
+ self.assertEquals(2*3, movement.employee_share_total_price)
+ self.assertEquals(4, movement.employer_share_price)
+ self.assertEquals(5, movement.employer_share_quantity)
+ self.assertEquals(4*5, movement.employer_share_total_price)
+
class TestNewPayroll(TestNewPayrollMixin):
BUSINESS_PATH_CREATION_SEQUENCE_STRING = """
@@ -1760,6 +1799,21 @@
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
+ def test_PaySheetTransaction_getMovementList(self):
+ '''
+ PaySheetTransaction_getMovementList is a script used by the listbox to
+ display information about lines in the Paysheet. Just test the return of
+ it.
+ '''
+ sequence_list = SequenceList()
+ sequence_string = """
+ CreateUrssafService
+ CreateBasicPaysheet
+ CheckPaySheetTransaction_getMovementListReturn
+ """
+ sequence_list.addSequenceString(sequence_string)
+ sequence_list.play(self)
+
import unittest
def test_suite():
suite = unittest.TestSuite()
Modified: erp5/trunk/products/ERP5/tests/testPayroll.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testPayroll.py?rev=27595&r1=27594&r2=27595&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testPayroll.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testPayroll.py [utf8] Tue Jun 16 11:18:00 2009
@@ -552,43 +552,6 @@
model_2.getCell('salary_range/france/tranche_a').getQuantityRangeMin())
self.assertEquals(2,
model_2.getCell('salary_range/france/tranche_a').getQuantityRangeMax())
-
- def test_PaySheetTransaction_getMovementList(self):
- # Tests PaySheetTransaction_getMovementList script
- pay_sheet = self.createPaySheet(self.model)
- # when pay sheet has no line, the script returns an empty list
- self.assertEquals(pay_sheet.PaySheetTransaction_getMovementList(), [])
- # we add a line, then it is returned in the list
- line = pay_sheet.newContent(portal_type='Pay Sheet Line')
- self.assertEquals(1, len(pay_sheet.PaySheetTransaction_getMovementList()))
-
- # if the line has cells with different tax categories, new properties are
- # added to this line.
- line.setResourceValue(self.urssaf)
- line.setVariationCategoryList(['tax_category/employee_share',
- 'tax_category/employer_share'])
- cell0 = line.newCell('tax_category/employee_share',
- portal_type='Pay Sheet Cell', base_id='movement')
- cell0.setMappedValuePropertyList(['quantity', 'price'])
- cell0.setVariationCategoryList(('tax_category/employee_share',))
- cell0.setPrice(2)
- cell0.setQuantity(3)
- cell1 = line.newCell('tax_category/employer_share',
- portal_type='Pay Sheet Cell', base_id='movement')
- cell1.setMappedValuePropertyList(['quantity', 'price'])
- cell1.setVariationCategoryList(('tax_category/employer_share',))
- cell1.setPrice(4)
- cell1.setQuantity(5)
-
- movement_list = pay_sheet.PaySheetTransaction_getMovementList()
- self.assertEquals(1, len(movement_list))
- movement = movement_list[0]
- self.assertEquals(2, movement.employee_share_price)
- self.assertEquals(3, movement.employee_share_quantity)
- self.assertEquals(2*3, movement.employee_share_total_price)
- self.assertEquals(4, movement.employer_share_price)
- self.assertEquals(5, movement.employer_share_quantity)
- self.assertEquals(4*5, movement.employer_share_total_price)
def test_createPaySheetLineZeroPrice(self):
# test the creation of lines when the price is set to zero: the line should
More information about the Erp5-report
mailing list