# HG changeset patch # User Julien Cristau # Date 1443693442 -7200 # Node ID 9ffdfa1d28f57c5a6dd09315e5f942f672a5aacf # Parent 1166a47dad40b8636a22df74b8eca9369e4bc526 [web/test] str vs bytes diff -r 1166a47dad40 -r 9ffdfa1d28f5 web/test/unittest_views_basecontrollers.py --- a/web/test/unittest_views_basecontrollers.py Thu Oct 01 11:50:42 2015 +0200 +++ b/web/test/unittest_views_basecontrollers.py Thu Oct 01 11:57:22 2015 +0200 @@ -409,7 +409,7 @@ } self.assertMultiLineEqual(''''''%seid, self.ctrl_publish(req, 'validateform')) +'''%seid, self.ctrl_publish(req, 'validateform').decode('ascii')) # ensure a value that comply a constraint is properly processed with self.admin_access.web_request(rollbackfirst=True) as req: @@ -420,7 +420,7 @@ } self.assertMultiLineEqual('''''', self.ctrl_publish(req, 'validateform')) +''', self.ctrl_publish(req, 'validateform').decode('ascii')) self.assertEqual(20, req.execute('Any V WHERE X amount V, X eid %(eid)s', {'eid': seid})[0][0]) @@ -448,11 +448,11 @@ with self.temporary_appobjects(ValidationErrorInOpAfterHook): self.assertMultiLineEqual('''''', self.ctrl_publish(req, 'validateform')) +''', self.ctrl_publish(req, 'validateform').decode('ascii')) self.assertMultiLineEqual('''''', self.ctrl_publish(req, 'validateform')) +''', self.ctrl_publish(req, 'validateform').decode('ascii')) def test_req_pending_insert(self): """make sure req's pending insertions are taken into account""" @@ -964,7 +964,7 @@ def js_foo(self): return u'hello' with self.remote_calling('foo') as (res, _): - self.assertEqual(res, u'hello') + self.assertEqual(res, b'hello') def test_monkeypatch_jsoncontroller_xhtmlize(self): with self.assertRaises(RemoteCallFailed): @@ -975,7 +975,7 @@ def js_foo(self): return u'hello' with self.remote_calling('foo') as (res, _): - self.assertEqual(u'
hello
', res) + self.assertEqual(b'
hello
', res) def test_monkeypatch_jsoncontroller_jsonize(self): with self.assertRaises(RemoteCallFailed): @@ -986,7 +986,7 @@ def js_foo(self): return 12 with self.remote_calling('foo') as (res, _): - self.assertEqual(res, '12') + self.assertEqual(res, b'12') def test_monkeypatch_jsoncontroller_stdfunc(self): @monkeypatch(JSonController) @@ -994,7 +994,7 @@ def js_reledit_form(self): return 12 with self.remote_calling('reledit_form') as (res, _): - self.assertEqual(res, '12') + self.assertEqual(res, b'12') class UndoControllerTC(CubicWebTC):