From 6227341b19b1c6c1b426b984f8ba76785fda3330 Mon Sep 17 00:00:00 2001
From: Leonardo Rochael Almeida <leonardo@nexedi.com>
Date: Wed, 30 Dec 2009 18:53:13 +0000
Subject: [PATCH] Always use the ERP5TypeTestCase.publish() methods.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31545 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5OOo/tests/testOOoStyle.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/product/ERP5OOo/tests/testOOoStyle.py b/product/ERP5OOo/tests/testOOoStyle.py
index 085fb1ed00..a5962aed59 100644
--- a/product/ERP5OOo/tests/testOOoStyle.py
+++ b/product/ERP5OOo/tests/testOOoStyle.py
@@ -36,8 +36,8 @@ from Products.ERP5OOo.tests.utils import Validator
 
 HTTP_OK = 200
 
-# setting this to a true value allow the use of a debugger
-debug = 0
+# setting this to True allows the .publish() calls to provide tracebacks
+debug = False
 
 class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
   """Tests ODF styles for ERP5."""
@@ -66,10 +66,9 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
     self.portal.portal_selections.setSelectionFor(
                         'person_module_selection', Selection())
 
-  if debug:
-    def publish(self, path, basic=None, **kw):
-      kw['handle_errors'] = False
-      return ZopeTestCase.Functional.publish(self, path, basic, **kw)
+  def publish(self, *args, **kw):
+    kw['handle_errors'] = not debug
+    return ERP5TypeTestCase.publish(self, *args, **kw)
 
   def _validate(self, odf_file_data):
     error_list = self.validator.validate(odf_file_data)
-- 
2.30.9