From 7367e81a709a93860a5038404be7f2ad2282dbf7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Wed, 11 Aug 2010 12:44:08 +0000
Subject: [PATCH] revert previous commit, it was not done in the right legacy
 test

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@37701 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Legacy/tests/testLegacyOrder.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/product/ERP5Legacy/tests/testLegacyOrder.py b/product/ERP5Legacy/tests/testLegacyOrder.py
index 58758109e3..6ed902e84a 100644
--- a/product/ERP5Legacy/tests/testLegacyOrder.py
+++ b/product/ERP5Legacy/tests/testLegacyOrder.py
@@ -100,6 +100,19 @@ class TestOrderMixin:
     self.validateRules()
     self.setUpPreferences()
 
+  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()
+      # do not use new 'XXX Simulation Rule' in legacy tests.
+      if 'Simulation Rule' in rule.getPortalType():
+        rule.invalidate()
+
   def createCurrency(self):
     currency_module = self.getPortal().currency_module
     if currency_module._getOb('euro', None) is None:
-- 
2.30.9