Commit 18fbfcb1 authored by Fabien Morin's avatar Fabien Morin

remove some test since they are in testNewPayroll...

remove some test since they are in testNewPayroll (test_applyModelSetCategories, test_applyModelTwice)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27601 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4746cdb5
......@@ -576,110 +576,6 @@ class TestPayroll(TestPayrollMixin):
pay_sheet_line_list = pay_sheet.contentValues(portal_type='Pay Sheet Line')
self.assertEquals(0, len(pay_sheet_line_list))
def test_apply_model(self):
eur = self.portal.currency_module.EUR
employee = self.portal.person_module.newContent(
portal_type='Person',
title='Employee')
employee_bank_account = employee.newContent(
portal_type='Bank Account')
employer = self.portal.organisation_module.newContent(
portal_type='Organisation',
title='Employer')
employer_bank_account = employee.newContent(
portal_type='Bank Account')
model = self.portal.paysheet_model_module.newContent(
portal_type='Pay Sheet Model',
source_section_value=employee,
source_payment_value=employee_bank_account,
destination_section_value=employer,
destination_payment_value=employer_bank_account,
price_currency_value=eur,
payment_condition_payment_date=DateTime(2008, 1, 1),
work_time_annotation_line_quantity=10)
paysheet = self.portal.accounting_module.newContent(
portal_type='Pay Sheet Transaction',
specialise_value=model)
paysheet.PaySheetTransaction_applyModel()
self.assertEquals(employee, paysheet.getSourceSectionValue())
self.assertEquals(employer, paysheet.getDestinationSectionValue())
self.assertEquals(employee_bank_account, paysheet.getSourcePaymentValue())
self.assertEquals(employer_bank_account, paysheet.getDestinationPaymentValue())
self.assertEquals(employee_bank_account,
paysheet.getPaymentConditionSourcePaymentValue())
self.assertEquals(employer_bank_account,
paysheet.getPaymentConditionDestinationPaymentValue())
self.assertEquals(eur, paysheet.getResourceValue())
self.assertEquals(eur, paysheet.getPriceCurrencyValue())
self.assertEquals(DateTime(2008, 1, 1),
paysheet.getPaymentConditionPaymentDate())
self.assertEquals(10, paysheet.getWorkTimeAnnotationLineQuantity())
# if not found on the first model, values are searched recursivly in the
# model hierarchy
other_model = self.portal.paysheet_model_module.newContent(
portal_type='Pay Sheet Model',
specialise_value=model)
paysheet = self.portal.accounting_module.newContent(
portal_type='Pay Sheet Transaction',
specialise_value=other_model)
paysheet.PaySheetTransaction_applyModel()
self.assertEquals(employee, paysheet.getSourceSectionValue())
self.assertEquals(employer, paysheet.getDestinationSectionValue())
self.assertEquals(eur, paysheet.getResourceValue())
self.assertEquals(eur, paysheet.getPriceCurrencyValue())
self.assertEquals(DateTime(2008, 1, 1),
paysheet.getPaymentConditionPaymentDate())
self.assertEquals(10, paysheet.getWorkTimeAnnotationLineQuantity())
# applying twice does not copy subdocument twice
self.assertEquals(2, len(paysheet.contentValues()))
paysheet.PaySheetTransaction_applyModel()
self.assertEquals(2, len(paysheet.contentValues()))
def test_apply_model_empty_line(self):
# apply a model with some empty lines
eur = self.portal.currency_module.EUR
employee = self.portal.person_module.newContent(
portal_type='Person',
title='Employee')
employer = self.portal.organisation_module.newContent(
portal_type='Organisation',
title='Employer')
model = self.portal.paysheet_model_module.newContent(
portal_type='Pay Sheet Model',
source_section_value=employee,
destination_section_value=employer,
price_currency_value=eur,
payment_condition_payment_date=DateTime(2008, 1, 1),
work_time_annotation_line_quantity=10)
employee_model = self.portal.paysheet_model_module.newContent(
portal_type='Pay Sheet Model',
specialise_value=model,
work_time_annotation_line_quantity=20)
employee_model.setWorkTimeAnnotationLineQuantity(None)
paysheet = self.portal.accounting_module.newContent(
portal_type='Pay Sheet Transaction',
specialise_value=employee_model)
paysheet.PaySheetTransaction_applyModel()
self.assertEquals(employee, paysheet.getSourceSectionValue())
self.assertEquals(employer, paysheet.getDestinationSectionValue())
self.assertEquals(eur, paysheet.getResourceValue())
self.assertEquals(eur, paysheet.getPriceCurrencyValue())
self.assertEquals(DateTime(2008, 1, 1),
paysheet.getPaymentConditionPaymentDate())
# WorkTimeAnnotationLine is not taken on employee_model, because the line
# is "empty", it is taken on model.
self.assertEquals(10, paysheet.getWorkTimeAnnotationLineQuantity())
# applying twice does not copy subdocument twice
self.assertEquals(2, len(paysheet.contentValues()))
paysheet.PaySheetTransaction_applyModel()
self.assertEquals(2, len(paysheet.contentValues()))
def test_PayrollTaxesReport(self):
eur = self.portal.currency_module.EUR
service = self.portal.service_module.newContent(
......
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