# HG changeset patch # User RĂ©mi Cardona # Date 1442910287 -7200 # Node ID bb91f581c389eb79b9bb8b038221253d8240b2aa # Parent 1776c94a74e8c2a42c21f0c1cb2ff0ca83c5d650 [py3k] PageInfo.source contains bytes diff -r 1776c94a74e8 -r bb91f581c389 web/test/test_views.py --- a/web/test/test_views.py Mon Sep 21 18:58:12 2015 +0200 +++ b/web/test/test_views.py Tue Sep 22 10:24:47 2015 +0200 @@ -57,12 +57,12 @@ with self.admin_access.web_request() as req: # sortable.js should not be included by default rset = req.execute('CWUser X') - self.assertNotIn('jquery.tablesorter.js', self.view('oneline', rset, req=req).source) + self.assertNotIn(b'jquery.tablesorter.js', self.view('oneline', rset, req=req).source) with self.admin_access.web_request() as req: # but should be included by the tableview rset = req.execute('Any P,F,S LIMIT 1 WHERE P is CWUser, P firstname F, P surname S') - self.assertIn('jquery.tablesorter.js', self.view('table', rset, req=req).source) + self.assertIn(b'jquery.tablesorter.js', self.view('table', rset, req=req).source) def test_js_added_only_once(self): with self.admin_access.web_request() as req: @@ -70,7 +70,7 @@ self.vreg.register(SomeView) rset = req.execute('CWUser X') source = self.view('someview', rset, req=req).source - self.assertEqual(source.count('spam.js'), 1) + self.assertEqual(source.count(b'spam.js'), 1) def test_unrelateddivs(self): with self.admin_access.client_cnx() as cnx: diff -r 1776c94a74e8 -r bb91f581c389 web/test/unittest_views_baseviews.py --- a/web/test/unittest_views_baseviews.py Mon Sep 21 18:58:12 2015 +0200 +++ b/web/test/unittest_views_baseviews.py Tue Sep 22 10:24:47 2015 +0200 @@ -129,8 +129,8 @@ source_lines = [line.strip() for line in html_source.splitlines(False) if line.strip()] - self.assertListEqual(['', - ''], + self.assertListEqual([b'', + b''], source_lines[:2]) def test_set_doctype_no_reset_xmldecl(self): @@ -151,9 +151,9 @@ source_lines = [line.strip() for line in html_source.splitlines(False) if line.strip()] - self.assertListEqual([html_doctype, - '', - ''], + self.assertListEqual([html_doctype.encode('ascii'), + b'', + b''], source_lines[:3]) if __name__ == '__main__':