summaryrefslogtreecommitdiff
path: root/src/zope/tal/tests/test_talinterpreter.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/zope/tal/tests/test_talinterpreter.py')
-rw-r--r--src/zope/tal/tests/test_talinterpreter.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/zope/tal/tests/test_talinterpreter.py b/src/zope/tal/tests/test_talinterpreter.py
index 3717851..1a77453 100644
--- a/src/zope/tal/tests/test_talinterpreter.py
+++ b/src/zope/tal/tests/test_talinterpreter.py
@@ -714,12 +714,19 @@ class OutputPresentationTestCase(TestCaseBase):
'alt="&a; &#1; &#x0a; &a &#45 &; <>" />')
EXPECTED = ('<img alt="&a; \x01 \n '
'&amp;a &amp;#45 &amp;; &lt;&gt;" />')
- else:
+ elif sys.version_info < (3, 4):
# html.parser.HTMLParser in Python 3.3 parses "&#45" as "-"
INPUT = ('<img tal:define="foo nothing" '
'alt="&a; &#1; &#x0a; &a &#45 &; <>" />')
EXPECTED = ('<img alt="&a; \x01 \n '
'&amp;a - &amp;; &lt;&gt;" />')
+ else:
+ # html.parser.HTMLParser in Python 3.4 parses "&#1" as ""
+ # because '1' is an "invalid codepoint".
+ INPUT = ('<img tal:define="foo nothing" '
+ 'alt="&a; &#1; &#x0a; &a &#45 &; <>" />')
+ EXPECTED = ('<img alt="&a; \n '
+ '&amp;a - &amp;; &lt;&gt;" />')
self.compare(INPUT, EXPECTED)
def compare(self, INPUT, EXPECTED):