-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- A bug was fixed whereby including numeric entity elements
in the source of a PageTemplate would cause a UnicodeDecodeError. [chrism] Repeat by attempting to run the following script under an unfixed version: import z3c.pt from zope.configuration import xmlconfig xmlconfig.file('configure.zcml', z3c.pt) pt = """<html xmlns="http://www.w3.org/1999/xhtml" xmlns:tal="http://xml.zope.org/namespaces/tal"> © </html>""" from z3c.pt.pagetemplate import PageTemplate t = PageTemplate(pt) t.render()
- Loading branch information
Showing
3 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import unittest | ||
|
||
class TestGenerator(unittest.TestCase): | ||
def test_generator_returns_utf_8_encoded_text(self): | ||
from z3c.pt.generation import Generator | ||
gen = Generator([]) | ||
from StringIO import StringIO | ||
gen.stream = StringIO(u'<div>\xc2\xa9</div>') | ||
code, ns = gen() | ||
self.failUnless(isinstance(code, str), repr(code)) | ||
|
||
def test_suite(): | ||
import sys | ||
return unittest.findTestCases(sys.modules[__name__]) |