Commit 8bec1d30 authored by Aurel's avatar Aurel

update unit test so that it uses the new base_amount category tree

This fixes error when calling reports in test


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33271 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d282d5bb
...@@ -116,9 +116,10 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -116,9 +116,10 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
"""return a list of categories that should be created.""" """return a list of categories that should be created."""
return ('contribution_share/employer', return ('contribution_share/employer',
'contribution_share/employee', 'contribution_share/employee',
'base_amount/deductible_tax', 'base_amount/payroll/base/income_tax',
'base_amount/base_salary', 'base_amount/payroll/base/contribution',
'base_amount/net_salary', 'base_amount/payroll/report/salary/net',
'base_amount/payroll/report/salary/gross',
'grade/worker', 'grade/worker',
'grade/engineer', 'grade/engineer',
'quantity_unit/time/month', 'quantity_unit/time/month',
...@@ -284,8 +285,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -284,8 +285,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
resource_value=sequence.get('urssaf_service'), resource_value=sequence.get('urssaf_service'),
variation_category_list=['contribution_share/employee', variation_category_list=['contribution_share/employee',
'contribution_share/employer'], 'contribution_share/employer'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/payroll/base/contribution'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/payroll/base/income_tax'])
sequence.edit(urssaf_model_line = model_line) sequence.edit(urssaf_model_line = model_line)
def stepModelCreateUrssafModelLineWithSlices(self, sequence=None, **kw): def stepModelCreateUrssafModelLineWithSlices(self, sequence=None, **kw):
...@@ -300,8 +301,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -300,8 +301,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
'salary_range/france/slice_0_to_200', 'salary_range/france/slice_0_to_200',
'salary_range/france/slice_200_to_400', 'salary_range/france/slice_200_to_400',
'salary_range/france/slice_400_to_5000'], 'salary_range/france/slice_400_to_5000'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/payroll/base/contribution'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/payroll/base/income_tax'])
sequence.edit(urssaf_model_line_with_slices = model_line) sequence.edit(urssaf_model_line_with_slices = model_line)
def stepModelCreateUrssafModelLineWithComplexSlices(self, sequence=None, **kw): def stepModelCreateUrssafModelLineWithComplexSlices(self, sequence=None, **kw):
...@@ -315,8 +316,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -315,8 +316,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
'contribution_share/employer', 'contribution_share/employer',
'salary_range/france/slice_200_to_400', 'salary_range/france/slice_200_to_400',
'salary_range/france/slice_600_to_800'], 'salary_range/france/slice_600_to_800'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/payroll/base/contribution'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/payroll/base/income_tax'])
sequence.edit(urssaf_model_line_with_slices = model_line) sequence.edit(urssaf_model_line_with_slices = model_line)
def stepPaysheetCreateUrssafModelLine(self, sequence=None, **kw): def stepPaysheetCreateUrssafModelLine(self, sequence=None, **kw):
...@@ -331,8 +332,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -331,8 +332,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
resource_value=sequence.get('urssaf_service'), resource_value=sequence.get('urssaf_service'),
variation_category_list=['contribution_share/employee', variation_category_list=['contribution_share/employee',
'contribution_share/employer'], 'contribution_share/employer'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/payroll/base/contribution'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/payroll/base/income_tax'])
sequence.edit(urssaf_model_line = model_line) sequence.edit(urssaf_model_line = model_line)
def stepUrssafModelLineCreateMovements(self, sequence=None, **kw): def stepUrssafModelLineCreateMovements(self, sequence=None, **kw):
...@@ -476,8 +477,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -476,8 +477,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
price=20, price=20,
quantity=150, quantity=150,
resource_value=sequence.get('labour_service'), resource_value=sequence.get('labour_service'),
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary']) 'base_amount/payroll/report/salary/gross'])
sequence.edit(labour_paysheet_line = paysheet_line) sequence.edit(labour_paysheet_line = paysheet_line)
def stepPaysheetCreateBonusPaySheetLine(self, sequence=None, **kw): def stepPaysheetCreateBonusPaySheetLine(self, sequence=None, **kw):
...@@ -487,7 +488,7 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -487,7 +488,7 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
resource_value=sequence.get('bonus_service'), resource_value=sequence.get('bonus_service'),
variation_category_list=['contribution_share/employee', variation_category_list=['contribution_share/employee',
'contribution_share/employer'], 'contribution_share/employer'],
base_contribution_list=[ 'base_amount/base_salary']) base_contribution_list=[ 'base_amount/payroll/base/contribution'])
sequence.edit(bonus_paysheet_line = paysheet_line) sequence.edit(bonus_paysheet_line = paysheet_line)
def stepPaysheetCreateBonusPaySheetLineMovements(self, sequence=None, **kw): def stepPaysheetCreateBonusPaySheetLineMovements(self, sequence=None, **kw):
...@@ -1050,8 +1051,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1050,8 +1051,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
reference='intermediate_line', reference='intermediate_line',
variation_category_list=['contribution_share/employee', variation_category_list=['contribution_share/employee',
'contribution_share/employer'], 'contribution_share/employer'],
base_contribution_list=['base_amount/deductible_tax'], base_contribution_list=['base_amount/payroll/base/income_tax'],
base_application_list=['base_amount/base_salary'], base_application_list=['base_amount/payroll/base/contribution'],
create_line=False,) create_line=False,)
sequence.edit(intermediate_model_line = model_line) sequence.edit(intermediate_model_line = model_line)
...@@ -1067,8 +1068,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1067,8 +1068,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
reference='line_applied_on_intermediate_line', reference='line_applied_on_intermediate_line',
variation_category_list=['contribution_share/employee', variation_category_list=['contribution_share/employee',
'contribution_share/employer'], 'contribution_share/employer'],
base_contribution_list=['base_amount/net_salary'], base_contribution_list=['base_amount/payroll/report/salary/net'],
base_application_list=['base_amount/deductible_tax']) base_application_list=['base_amount/payroll/base/income_tax'])
sequence.edit(model_line_applied_on_tax = model_line) sequence.edit(model_line_applied_on_tax = model_line)
def stepIntermediateModelLineCreateMovements(self, sequence=None, def stepIntermediateModelLineCreateMovements(self, sequence=None,
...@@ -1107,8 +1108,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1107,8 +1108,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
reference='old_age_insurance', reference='old_age_insurance',
variation_category_list=['contribution_share/employee', variation_category_list=['contribution_share/employee',
'contribution_share/employer'], 'contribution_share/employer'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/payroll/base/contribution'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/payroll/base/income_tax'])
sequence.edit(old_age_insurance = model_line) sequence.edit(old_age_insurance = model_line)
def stepOldAgeInsuranceModelLineCreateMovements(self, sequence=None, **kw): def stepOldAgeInsuranceModelLineCreateMovements(self, sequence=None, **kw):
...@@ -1133,8 +1134,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1133,8 +1134,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
reference='sickness_insurance', reference='sickness_insurance',
variation_category_list=['contribution_share/employee', variation_category_list=['contribution_share/employee',
'contribution_share/employer'], 'contribution_share/employer'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/payroll/base/contribution'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/payroll/base/income_tax'])
sequence.edit(sickness_insurance = model_line) sequence.edit(sickness_insurance = model_line)
def stepSicknessInsuranceModelLineCreateMovements(self, sequence=None, **kw): def stepSicknessInsuranceModelLineCreateMovements(self, sequence=None, **kw):
...@@ -1185,8 +1186,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1185,8 +1186,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
reference='model_line_in_the_payesheet', reference='model_line_in_the_payesheet',
variation_category_list=['contribution_share/employee', variation_category_list=['contribution_share/employee',
'contribution_share/employer'], 'contribution_share/employer'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/payroll/base/contribution'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/payroll/base/income_tax'])
sequence.edit(model_line_on_paysheet = model_line) sequence.edit(model_line_on_paysheet = model_line)
def stepPaysheetModelLineCreateMovements(self, sequence=None, **kw): def stepPaysheetModelLineCreateMovements(self, sequence=None, **kw):
...@@ -1474,8 +1475,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1474,8 +1475,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
trade_phase='payroll/france/labour', trade_phase='payroll/france/labour',
reference='model_without_ref', reference='model_without_ref',
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=10000) quantity=10000)
# create the paysheet # create the paysheet
...@@ -1521,8 +1522,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1521,8 +1522,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
trade_phase='payroll/france/labour', trade_phase='payroll/france/labour',
reference='model_without_date', reference='model_without_date',
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=10000) quantity=10000)
# create a paysheet without date # create a paysheet without date
...@@ -1597,8 +1598,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1597,8 +1598,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
trade_phase='payroll/france/labour', trade_phase='payroll/france/labour',
reference='check_model_date_validity_1', reference='check_model_date_validity_1',
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=20000, quantity=20000,
price=1) price=1)
...@@ -1607,8 +1608,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1607,8 +1608,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
trade_phase='payroll/france/labour', trade_phase='payroll/france/labour',
reference='check_model_date_validity_2', reference='check_model_date_validity_2',
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=30000, quantity=30000,
price=1) price=1)
self.stepTic() self.stepTic()
...@@ -1706,8 +1707,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1706,8 +1707,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
reference='zero_price_line', reference='zero_price_line',
portal_type='Pay Sheet Model Line', portal_type='Pay Sheet Model Line',
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=5, quantity=5,
price=0) price=0)
...@@ -1745,8 +1746,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1745,8 +1746,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
model_line_1 = self.createModelLine(model_1) model_line_1 = self.createModelLine(model_1)
model_line_1.edit( model_line_1.edit(
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=10000) quantity=10000)
# define two models with same references and same dates # define two models with same references and same dates
...@@ -1761,8 +1762,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1761,8 +1762,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
model_line_2 = self.createModelLine(model_2) model_line_2 = self.createModelLine(model_2)
model_line_2.edit( model_line_2.edit(
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=20000) quantity=20000)
model_3 = paysheet_model_module.newContent( \ model_3 = paysheet_model_module.newContent( \
...@@ -1775,8 +1776,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1775,8 +1776,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
model_line_3 = self.createModelLine(model_3) model_line_3 = self.createModelLine(model_3)
model_line_3.edit( model_line_3.edit(
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=30000) quantity=30000)
# define two models with same references and same dates # define two models with same references and same dates
...@@ -1791,8 +1792,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1791,8 +1792,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
model_line_4 = self.createModelLine(model_4) model_line_4 = self.createModelLine(model_4)
model_line_4.edit( model_line_4.edit(
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=40000) quantity=40000)
model_5 = paysheet_model_module.newContent( \ model_5 = paysheet_model_module.newContent( \
...@@ -1805,8 +1806,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1805,8 +1806,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
model_line_5 = self.createModelLine(model_5) model_line_5 = self.createModelLine(model_5)
model_line_5.edit( model_line_5.edit(
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=50000) quantity=50000)
# third level : define two models with same references and same dates # third level : define two models with same references and same dates
...@@ -1821,8 +1822,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1821,8 +1822,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
model_line_6 = self.createModelLine(model_6) model_line_6 = self.createModelLine(model_6)
model_line_6.edit( model_line_6.edit(
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=60000) quantity=60000)
model_7 = paysheet_model_module.newContent( \ model_7 = paysheet_model_module.newContent( \
...@@ -1835,8 +1836,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1835,8 +1836,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
model_line_7 = self.createModelLine(model_7) model_line_7 = self.createModelLine(model_7)
model_line_7.edit( model_line_7.edit(
resource_value=labour, resource_value=labour,
base_contribution_list=['base_amount/base_salary', base_contribution_list=['base_amount/payroll/base/contribution',
'base_amount/gross_salary'], 'base_amount/payroll/report/salary/gross'],
quantity=70000) quantity=70000)
self.stepTic() self.stepTic()
...@@ -2831,7 +2832,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -2831,7 +2832,7 @@ class TestPayroll(TestPayrollMixin):
line = ps1.newContent(portal_type='Pay Sheet Line', line = ps1.newContent(portal_type='Pay Sheet Line',
resource_value=salary_service, resource_value=salary_service,
destination_value=employee1, destination_value=employee1,
base_contribution_list=['base_amount/net_salary',], base_contribution_list=['base_amount/payroll/report/salary/net',],
variation_category_list=('contribution_share/employee', variation_category_list=('contribution_share/employee',
'contribution_share/employer')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee', cell_employee = line.newCell('contribution_share/employee',
...@@ -2844,7 +2845,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -2844,7 +2845,7 @@ class TestPayroll(TestPayrollMixin):
resource_value=service, resource_value=service,
source_section_value=provider, source_section_value=provider,
destination_value=employee1, destination_value=employee1,
base_contribution_list=['base_amount/net_salary',], base_contribution_list=['base_amount/payroll/report/salary/net',],
variation_category_list=('contribution_share/employee', variation_category_list=('contribution_share/employee',
'contribution_share/employer')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee', cell_employee = line.newCell('contribution_share/employee',
...@@ -2871,7 +2872,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -2871,7 +2872,7 @@ class TestPayroll(TestPayrollMixin):
line = ps2.newContent(portal_type='Pay Sheet Line', line = ps2.newContent(portal_type='Pay Sheet Line',
resource_value=salary_service, resource_value=salary_service,
destination_value=employee2, destination_value=employee2,
base_contribution_list=['base_amount/net_salary',], base_contribution_list=['base_amount/payroll/report/salary/net',],
variation_category_list=('contribution_share/employee', variation_category_list=('contribution_share/employee',
'contribution_share/employer')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee', cell_employee = line.newCell('contribution_share/employee',
...@@ -2884,7 +2885,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -2884,7 +2885,7 @@ class TestPayroll(TestPayrollMixin):
resource_value=service, resource_value=service,
source_section_value=provider, source_section_value=provider,
destination_value=employee2, destination_value=employee2,
base_contribution_list=['base_amount/net_salary',], base_contribution_list=['base_amount/payroll/report/salary/net',],
variation_category_list=('contribution_share/employee', variation_category_list=('contribution_share/employee',
'contribution_share/employer')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee', cell_employee = line.newCell('contribution_share/employee',
......
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