summaryrefslogtreecommitdiff
path: root/src/zope/pagetemplate/tests
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2010-07-08 14:22:07 +0000
committerFred Drake <fdrake@acm.org>2010-07-08 14:22:07 +0000
commit90179881d5b1da56a1b3cd0722cb68420b1dec1f (patch)
tree6988e6ad52d60380d3025a833e6840d5b7c500fb /src/zope/pagetemplate/tests
parent8689f748a48ef25cf21ef5019affec45d20c334c (diff)
downloadzope-pagetemplate-90179881d5b1da56a1b3cd0722cb68420b1dec1f.tar.gz
make the PTRuntimeError exception message consistent across Python versions
Diffstat (limited to 'src/zope/pagetemplate/tests')
-rw-r--r--src/zope/pagetemplate/tests/test_basictemplate.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/zope/pagetemplate/tests/test_basictemplate.py b/src/zope/pagetemplate/tests/test_basictemplate.py
index f5cb5df..d77f665 100644
--- a/src/zope/pagetemplate/tests/test_basictemplate.py
+++ b/src/zope/pagetemplate/tests/test_basictemplate.py
@@ -16,12 +16,13 @@
import unittest
from zope.pagetemplate.tests import util
-from zope.pagetemplate.pagetemplate import PageTemplate
+import zope.pagetemplate.pagetemplate
+
class BasicTemplateTests(unittest.TestCase):
def setUp(self):
- self.t = PageTemplate()
+ self.t = zope.pagetemplate.pagetemplate.PageTemplate()
def test_if_in_var(self):
# DTML test 1: if, in, and var:
@@ -59,6 +60,19 @@ class BasicTemplateTests(unittest.TestCase):
expect = util.read_output('dtml1b.html')
util.check_xml(expect, o)
+ def test_pt_runtime_error(self):
+ self.t.write("<tal:block define='a string:foo'>xyz")
+ try:
+ self.t.pt_render({})
+ except zope.pagetemplate.pagetemplate.PTRuntimeError, e:
+ self.assertEquals(
+ str(e),
+ "['Compilation failed', 'zope.tal.taldefs.TALError:"
+ " TAL attributes on <tal:block> require explicit"
+ " </tal:block>, at line 1, column 1']")
+ else:
+ self.fail("expected PTRuntimeError")
+
def test_batches_and_formatting(self):
# DTML test 3: batches and formatting:
pass # for unittest