# HG changeset patch # User Rémi Cardona # Date 1442853338 -7200 # Node ID aa3eedba866ce74016eb19e3dac5e7128f681bbd # Parent c5bedfdd1b22ea9c5c235382c47bd1517c29585c [py3k] unicode → six.text_type diff -r c5bedfdd1b22 -r aa3eedba866c hooks/test/unittest_hooks.py --- a/hooks/test/unittest_hooks.py Mon Sep 21 18:28:10 2015 +0200 +++ b/hooks/test/unittest_hooks.py Mon Sep 21 18:35:38 2015 +0200 @@ -24,9 +24,12 @@ from datetime import datetime +from six import text_type + from cubicweb import ValidationError, AuthenticationError, BadConnectionId from cubicweb.devtools.testlib import CubicWebTC + class CoreHooksTC(CubicWebTC): def test_inlined(self): @@ -207,7 +210,7 @@ with self.assertRaises(ValidationError) as cm: cnx.execute('INSERT CWUser X: X login "admin"') ex = cm.exception - ex.translate(unicode) + ex.translate(text_type) self.assertIsInstance(ex.entity, int) self.assertEqual(ex.errors, {'login-subject': 'the value "admin" is already used, use another one'}) diff -r c5bedfdd1b22 -r aa3eedba866c hooks/test/unittest_syncsession.py --- a/hooks/test/unittest_syncsession.py Mon Sep 21 18:28:10 2015 +0200 +++ b/hooks/test/unittest_syncsession.py Mon Sep 21 18:35:38 2015 +0200 @@ -22,6 +22,8 @@ syncschema.py hooks are mostly tested in server/test/unittest_migrations.py """ +from six import text_type + from cubicweb import ValidationError from cubicweb.devtools.testlib import CubicWebTC @@ -32,13 +34,13 @@ with self.assertRaises(ValidationError) as cm: req.execute('INSERT CWProperty X: X pkey "bla.bla", ' 'X value "hop", X for_user U') - cm.exception.translate(unicode) + cm.exception.translate(text_type) self.assertEqual(cm.exception.errors, {'pkey-subject': 'unknown property key bla.bla'}) with self.assertRaises(ValidationError) as cm: req.execute('INSERT CWProperty X: X pkey "bla.bla", X value "hop"') - cm.exception.translate(unicode) + cm.exception.translate(text_type) self.assertEqual(cm.exception.errors, {'pkey-subject': 'unknown property key bla.bla'})