Commit 910f2dd8 authored by Aurel's avatar Aurel

factorize some methods


git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@37736 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d7b9c82b
......@@ -75,6 +75,21 @@ class TestOrderMixin:
'erp5_invoicing', 'erp5_simplified_invoicing', 'erp5_apparel',
'erp5_project', 'erp5_simulation', 'erp5_legacy', 'erp5_administration')
def validateRules(self):
"""
try to validate all rules in rule_tool.
"""
rule_tool = self.getRuleTool()
for rule in rule_tool.contentValues(
portal_type=rule_tool.getPortalRuleTypeList()):
if rule.getValidationState() != 'validated':
rule.validate()
for rule in rule_tool.contentValues(
portal_type=rule_tool.getPortalRuleTypeList()):
if rule.getValidationState() == 'validated' and rule.getReference() == 'default_accounting_transaction_rule':
rule.invalidate()
def login(self, quiet=0, run=1):
uf = self.getPortal().acl_users
uf._doAddUser('rc', '', ['Manager', 'Member', 'Assignee'], [])
......
......@@ -80,11 +80,6 @@ class TestInvoiceMixin(TestPackingListMixin,
def getTitle(self):
return "Invoices"
def getBusinessTemplateList(self):
return ('erp5_base', 'erp5_pdm', 'erp5_trade', 'erp5_accounting',
'erp5_invoicing', 'erp5_simplified_invoicing', 'erp5_apparel',
'erp5_project', 'erp5_legacy', 'erp5_administration')
@UnrestrictedMethod
def createCategories(self):
"""Create the categories for our test. """
......
......@@ -155,21 +155,6 @@ class TestPackingListMixin(TestOrderMixin):
"""
return 1
def validateRules(self):
"""
try to validate all rules in rule_tool.
"""
rule_tool = self.getRuleTool()
for rule in rule_tool.contentValues(
portal_type=rule_tool.getPortalRuleTypeList()):
if rule.getValidationState() != 'validated':
rule.validate()
for rule in rule_tool.contentValues(
portal_type=rule_tool.getPortalRuleTypeList()):
if rule.getValidationState() == 'validated' and rule.getReference() == 'default_accounting_transaction_rule':
rule.invalidate()
def stepCheckOrderPackingList(self, sequence=None, sequence_list=None, **kw):
"""
Test if packing list is matching order
......
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