From 04a1efe8c6c6e0681fb36cd729af1daaef5afd8f Mon Sep 17 00:00:00 2001 From: Yoshinori Okuji <yo@nexedi.com> Date: Fri, 5 Oct 2007 01:27:15 +0000 Subject: [PATCH] Use iHotfix.originalStringIO rather than re-importing StringIO to make sure that unit tests use the same class. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16839 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/tests/ERP5TypeTestCase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/product/ERP5Type/tests/ERP5TypeTestCase.py b/product/ERP5Type/tests/ERP5TypeTestCase.py index d382dcec7a..0ae04946ce 100644 --- a/product/ERP5Type/tests/ERP5TypeTestCase.py +++ b/product/ERP5Type/tests/ERP5TypeTestCase.py @@ -80,17 +80,17 @@ try: # ZopeTestCase REQUESTs ZopeTestCase.installProduct('iHotfix', quiet=install_product_quiet) from Products import iHotfix - from StringIO import StringIO as OrigStringIO from types import UnicodeType # revert monkey patchs from iHotfix iHotfix.get_request = get_request - class UnicodeSafeStringIO(OrigStringIO): + originalStringIO = iHotfix.originalStringIO + class UnicodeSafeStringIO(originalStringIO): """StringIO like class which never fails with unicode.""" def write(self, s): if isinstance(s, UnicodeType): s = s.encode('utf8', 'repr') - OrigStringIO.write(self, s) + originalStringIO.write(self, s) # iHotFix will patch PageTemplate StringIO with iHotfix.iHotfixStringIO = UnicodeSafeStringIO except ImportError: -- 2.30.9