[Erp5-report] r16839 - /erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 5 03:27:15 CEST 2007


Author: yo
Date: Fri Oct  5 03:27:15 2007
New Revision: 16839

URL: http://svn.erp5.org?rev=16839&view=rev
Log:
Use iHotfix.originalStringIO rather than re-importing StringIO to make sure that unit tests use the same class.

Modified:
    erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py

Modified: erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py?rev=16839&r1=16838&r2=16839&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py (original)
+++ erp5/trunk/products/ERP5Type/tests/ERP5TypeTestCase.py Fri Oct  5 03:27:15 2007
@@ -80,17 +80,17 @@
   # 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:




More information about the Erp5-report mailing list