Commit 1d8df798 authored by Tres Seaver's avatar Tres Seaver

Forward-port fix for #2213 from 2.10 branch.

parent 813e1fc8
......@@ -11,6 +11,8 @@ Zope Changes
- Removed deprecated support for product initialization based on
'__ac_permissions__' and 'meta_types' attributes.
- Collector #2213: Can't edit "old" ZopePageTemplate instances.
- reStructuredText/ZReST: setting raw_enabled to 0 for security
reasons
......@@ -41,8 +43,8 @@ Zope Changes
- Collector #2209: ZTUtils module could not be used inside ZPT
- Collector #2208: rewriting/setting the 'charset' part of the content-type
HTTP header will be done only for 'text/*'
- Collector #2208: rewriting/setting the 'charset' part of the
content-type HTTP header will be done only for 'text/*'
- Call setDefaultSkin on new requests created as the result of
ConflictError retries.
......
......@@ -79,6 +79,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
func_defaults = None
func_code = FuncCode((), 0)
strict = False
_default_bindings = {'name_subpath': 'traverse_subpath'}
_default_content_fn = os.path.join(package_home(globals()),
......
......@@ -40,7 +40,7 @@ class ZPTRegressions(unittest.TestCase):
self.assertEqual(pt.document_src().strip(), default_text.strip())
def testAddWithRequest(self):
"""Test manage_add with file"""
# Test manage_add with file
request = self.app.REQUEST
request.form['file'] = DummyFileUpload(filename='some file',
data=self.text,
......@@ -51,13 +51,21 @@ class ZPTRegressions(unittest.TestCase):
self.assertEqual(pt.document_src(), self.text)
def testAddWithRequestButNoFile(self):
"""Collector #596: manage_add with text but no file"""
# Collector #596: manage_add with text but no file
request = self.app.REQUEST
self._addPT('pt1', text=self.text, REQUEST=request)
# no object is returned when REQUEST is passed.
pt = self.app.pt1
self.assertEqual(pt.document_src(), self.text)
def test_BBB_for_strict_attribute(self):
# Collector 2213: old templates don't have 'strict' attribute.
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
zpt = ZopePageTemplate('issue_2213')
del zpt.strict # simulate old templates
self.assertEqual(zpt.strict, False)
class ZPTMacros(zope.component.testing.PlacelessSetup, unittest.TestCase):
def setUp(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment