Commit 7d70f435 authored by Alexandre Boeglin's avatar Alexandre Boeglin

move validateRules method to ERP5TypeTestCase.py, use it in testInvoiceVAT

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17449 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3d2bf49a
...@@ -56,6 +56,7 @@ class TestInvoiceVAT(ERP5TypeTestCase): ...@@ -56,6 +56,7 @@ class TestInvoiceVAT(ERP5TypeTestCase):
"""set up """ """set up """
self.createCategories() self.createCategories()
self.login() self.login()
self.validateRules()
def _safeTic(self): def _safeTic(self):
"""Like tic, but swallowing errors, usefull for teardown""" """Like tic, but swallowing errors, usefull for teardown"""
......
...@@ -108,16 +108,6 @@ class TestOrderMixin: ...@@ -108,16 +108,6 @@ class TestOrderMixin:
portal_type='Category', portal_type='Category',
id=category_id) id=category_id)
def validateRules(self, sequence=None, sequence_list=[]):
"""
does what it says it does
"""
rule_tool = self.getRuleTool()
for rule in rule_tool.contentValues(
portal_type=rule_tool.getPortalRuleTypeList()):
if rule.getValidationState() != 'validated':
rule.validate()
def stepTic(self,**kw): def stepTic(self,**kw):
self.tic() self.tic()
......
...@@ -474,6 +474,15 @@ class ERP5TypeTestCase(PortalTestCase): ...@@ -474,6 +474,15 @@ class ERP5TypeTestCase(PortalTestCase):
return getattr(self.getPortal(), 'currency_module', return getattr(self.getPortal(), 'currency_module',
getattr(self.getPortal(), 'currency', None)) getattr(self.getPortal(), 'currency', None))
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()):
rule.validate()
def tic(self): def tic(self):
""" """
Start all messages Start all messages
......
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