--- a/server/test/unittest_undo.py Fri Jun 17 18:50:13 2011 +0200
+++ b/server/test/unittest_undo.py Fri Jun 17 18:53:33 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()