From 0ff7e556def852e78556379ee5e042c42d448eb6 Mon Sep 17 00:00:00 2001
From: Alexandre Boeglin <alex@nexedi.com>
Date: Tue, 6 Nov 2007 17:08:42 +0000
Subject: [PATCH] validate simulation rules

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17426 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testOrder.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/product/ERP5/tests/testOrder.py b/product/ERP5/tests/testOrder.py
index 7e9385f188..3b63f124b8 100644
--- a/product/ERP5/tests/testOrder.py
+++ b/product/ERP5/tests/testOrder.py
@@ -71,6 +71,7 @@ class TestOrderMixin:
     portal_catalog = self.getCatalogTool()
     #portal_catalog.manage_catalogClear()
     self.createCategories()
+    self.validateRules()
 
   def createCategories(self):
     """
@@ -107,6 +108,17 @@ class TestOrderMixin:
                                                  portal_type='Category',
                                                  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()
+        rule.recursiveReindexObject()
+
   def stepTic(self,**kw):
     self.tic()
 
-- 
2.30.9