equal
deleted
inserted
replaced
127 with self.temporary_appobjects(MyView): |
127 with self.temporary_appobjects(MyView): |
128 html_source = self.view('my-view', req=req).source |
128 html_source = self.view('my-view', req=req).source |
129 source_lines = [line.strip() |
129 source_lines = [line.strip() |
130 for line in html_source.splitlines(False) |
130 for line in html_source.splitlines(False) |
131 if line.strip()] |
131 if line.strip()] |
132 self.assertListEqual(['<!DOCTYPE html>', |
132 self.assertListEqual([b'<!DOCTYPE html>', |
133 '<html xmlns:cubicweb="http://www.cubicweb.org" lang="en">'], |
133 b'<html xmlns:cubicweb="http://www.cubicweb.org" lang="en">'], |
134 source_lines[:2]) |
134 source_lines[:2]) |
135 |
135 |
136 def test_set_doctype_no_reset_xmldecl(self): |
136 def test_set_doctype_no_reset_xmldecl(self): |
137 """ |
137 """ |
138 tests `cubicweb.web.request.CubicWebRequestBase.set_doctype` |
138 tests `cubicweb.web.request.CubicWebRequestBase.set_doctype` |
149 with self.temporary_appobjects(MyView): |
149 with self.temporary_appobjects(MyView): |
150 html_source = self.view('my-view', req=req).source |
150 html_source = self.view('my-view', req=req).source |
151 source_lines = [line.strip() |
151 source_lines = [line.strip() |
152 for line in html_source.splitlines(False) |
152 for line in html_source.splitlines(False) |
153 if line.strip()] |
153 if line.strip()] |
154 self.assertListEqual([html_doctype, |
154 self.assertListEqual([html_doctype.encode('ascii'), |
155 '<html xmlns:cubicweb="http://www.cubicweb.org" lang="cz">', |
155 b'<html xmlns:cubicweb="http://www.cubicweb.org" lang="cz">', |
156 '<head>'], |
156 b'<head>'], |
157 source_lines[:3]) |
157 source_lines[:3]) |
158 |
158 |
159 if __name__ == '__main__': |
159 if __name__ == '__main__': |
160 unittest_main() |
160 unittest_main() |