Commit 6b50bdb4 authored by Julien Muchembled's avatar Julien Muchembled

TestCommerce: fix validation of order rule

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@39507 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d7d459cf
......@@ -109,6 +109,10 @@ class TestCommerce(ERP5TypeTestCase):
'erp5_commerce',
'erp5_simulation_test')
def getRule(self, **kw):
return self.portal.portal_rules.searchFolder(
sort_on='version', sort_order='descending', **kw)[0].getObject()
def afterSetUp(self):
uf = self.getPortal().acl_users
uf._doAddUser('ivan', '', ['Manager'], [])
......@@ -160,9 +164,9 @@ class TestCommerce(ERP5TypeTestCase):
shipping.publish()
# validate default order rule
default_order_rule = self.portal.portal_rules.default_order_rule
if default_order_rule.getValidationState() != 'validated':
self.portal.portal_rules.default_order_rule.validate()
rule = self.getRule(reference='default_order_rule')
if rule.getValidationState() != 'validated':
rule.validate()
self.website = self.setupWebSite()
self.website.setProperty('ecommerce_base_currency',
......
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