Commit 67c55989 authored by Jérome Perrin's avatar Jérome Perrin

use simple scripts SimulationMovement_isTaxMovement and

SimulationMovement_isDeliveryMovement in the rule.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20544 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 43825707
...@@ -87,8 +87,7 @@ class TradeConditionTestCase(ERP5TypeTestCase): ...@@ -87,8 +87,7 @@ class TradeConditionTestCase(ERP5TypeTestCase):
self.portal.portal_simulation, self.portal.portal_simulation,
self.trade_condition_module, self.trade_condition_module,
self.order_module, self.order_module,
self.portal.portal_categories.base_amount, self.portal.portal_categories.base_amount,):
self.portal.portal_categories.product_line):
module.manage_delObjects(list(module.objectIds())) module.manage_delObjects(list(module.objectIds()))
if 'test_invoice_transaction_rule' in self.portal.portal_rules.objectIds(): if 'test_invoice_transaction_rule' in self.portal.portal_rules.objectIds():
self.portal.portal_rules.manage_delObjects('test_invoice_transaction_rule') self.portal.portal_rules.manage_delObjects('test_invoice_transaction_rule')
...@@ -131,16 +130,6 @@ class AccountingBuildTestCase(TradeConditionTestCase): ...@@ -131,16 +130,6 @@ class AccountingBuildTestCase(TradeConditionTestCase):
for account in self.portal.account_module.contentValues(): for account in self.portal.account_module.contentValues():
self.assertNotEquals(account.getAccountTypeValue(), None) self.assertNotEquals(account.getAccountTypeValue(), None)
account.validate() account.validate()
dummy_resource = self.portal.portal_categories.product_line.newContent(
id='dummy_resource',
title='Dummy Resource')
self.resource.setProductLineValue(dummy_resource)
dummy_tax = self.portal.portal_categories.product_line.newContent(
id='dummy_tax',
title='Dummy Tax')
# FIXME: tax should not have a product line
self.tax.setProductLineValue(dummy_tax)
itr = self.portal.portal_rules.newContent( itr = self.portal.portal_rules.newContent(
portal_type='Invoice Transaction Rule', portal_type='Invoice Transaction Rule',
...@@ -154,15 +143,13 @@ class AccountingBuildTestCase(TradeConditionTestCase): ...@@ -154,15 +143,13 @@ class AccountingBuildTestCase(TradeConditionTestCase):
string_index='resource_type', string_index='resource_type',
title='Resource Product', title='Resource Product',
int_index=1, int_index=1,
membership_criterion_base_category_list=['product_line',], test_method_id='SimulationMovement_isDeliveryMovement' )
membership_criterion_category_list=['product_line/dummy_resource'],)
predicate = itr.newContent(portal_type='Predicate') predicate = itr.newContent(portal_type='Predicate')
predicate.edit( predicate.edit(
string_index='resource_type', string_index='resource_type',
title='Resource Tax', title='Resource Tax',
int_index=2, int_index=2,
membership_criterion_base_category_list=['product_line',], test_method_id='SimulationMovement_isTaxMovement' )
membership_criterion_category_list=['product_line/dummy_tax'],)
get_transaction().commit() get_transaction().commit()
self.tic() self.tic()
accounting_rule_cell_list = itr.contentValues( accounting_rule_cell_list = itr.contentValues(
......
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