server/test/unittest_undo.py
branchstable
changeset 7530 15178bf89fb6
parent 7424 2c72bfbbf1a3
child 7536 29961a416faa
--- a/server/test/unittest_undo.py	Thu Jun 16 12:31:27 2011 +0200
+++ b/server/test/unittest_undo.py	Thu Jun 09 16:41:41 2011 +0200
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
@@ -21,9 +22,11 @@
 from cubicweb.devtools.testlib import CubicWebTC
 from cubicweb.transaction import *
 
+from cubicweb.server.sources.native import UndoException
+
+
 class UndoableTransactionTC(CubicWebTC):
 
-        
     def setup_database(self):
         req = self.request()
         self.session.undo_actions = set('CUDAR')
@@ -285,6 +288,15 @@
 
     # test implicit 'replacement' of an inlined relation
 
+
+class UndoExceptionInUnicode(CubicWebTC):
+
+    # problem occurs in string manipulation for python < 2.6
+    def test___unicode__method(self):
+        u = UndoException(u"voilĂ ")
+        self.assertIsInstance(unicode(u), unicode)
+
+
 if __name__ == '__main__':
     from logilab.common.testlib import unittest_main
     unittest_main()