Mercurial > genshi > genshi-test
comparison genshi/tests/output.py @ 932:e53161c2773c
Merge r1140 from py3k:
add support for python 3 to core genshi components (genshi.core, genshi.input and genshi.output):
* default input and output encodings changed from UTF-8 to None (i.e. unicode strings)
* Namespace and QName objects do not call stringrepr in __repr__ in Python 3 since repr() returns a unicode string there.
* track changes to expat parser in Python 3 (mostly it accepts bytes instead of strings)
author | hodgestar |
---|---|
date | Fri, 18 Mar 2011 09:08:12 +0000 |
parents | 37fb3988647a |
children |
comparison
equal
deleted
inserted
replaced
931:ade3abe742e9 | 932:e53161c2773c |
---|---|
354 <p></p> | 354 <p></p> |
355 <p></p> | 355 <p></p> |
356 </div>""", output) | 356 </div>""", output) |
357 | 357 |
358 def test_html5_doctype(self): | 358 def test_html5_doctype(self): |
359 stream = HTML('<html></html>') | 359 stream = HTML(u'<html></html>') |
360 output = stream.render(XHTMLSerializer, doctype=DocType.HTML5, | 360 output = stream.render(XHTMLSerializer, doctype=DocType.HTML5, |
361 encoding=None) | 361 encoding=None) |
362 self.assertEqual('<!DOCTYPE html>\n<html></html>', output) | 362 self.assertEqual('<!DOCTYPE html>\n<html></html>', output) |
363 | 363 |
364 | 364 |
425 self.assertEqual("""<style> | 425 self.assertEqual("""<style> |
426 html > body { display: none; } | 426 html > body { display: none; } |
427 </style>""", output) | 427 </style>""", output) |
428 | 428 |
429 def test_html5_doctype(self): | 429 def test_html5_doctype(self): |
430 stream = HTML('<html></html>') | 430 stream = HTML(u'<html></html>') |
431 output = stream.render(HTMLSerializer, doctype=DocType.HTML5, | 431 output = stream.render(HTMLSerializer, doctype=DocType.HTML5, |
432 encoding=None) | 432 encoding=None) |
433 self.assertEqual('<!DOCTYPE html>\n<html></html>', output) | 433 self.assertEqual('<!DOCTYPE html>\n<html></html>', output) |
434 | 434 |
435 | 435 |