[Checkins] SVN: Zope/branches/2.10/ Collector #2213: Can't edit "old" ZopePageTemplate instances.

Tres Seaver tseaver at palladion.com
Wed Nov 1 09:37:14 EST 2006


Log message for revision 71018:
  Collector #2213: Can't edit "old" ZopePageTemplate instances.
  
  o Also, made docstrings in testcase methods into comments, per coding standard.
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py
  U   Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.10/doc/CHANGES.txt	2006-11-01 14:29:33 UTC (rev 71017)
+++ Zope/branches/2.10/doc/CHANGES.txt	2006-11-01 14:37:13 UTC (rev 71018)
@@ -8,9 +8,11 @@
 
     Bugs fixed
 
-      - Collector #2208: rewriting/setting the 'charset' part of the content-type
-        HTTP header will be done only for 'text/*'
+      - Collector #2213: Can't edit "old" ZopePageTemplate instances.
 
+      - Collector #2208: rewriting/setting the 'charset' part of the
+        content-type HTTP header will be done only for 'text/*'
+
       - Collector #2209: ZTUtils module could not be used inside ZPT
 
       - Collector #2206: Set PYTHONPATH to include existing PYTHONPATH
@@ -43,7 +45,8 @@
       - Collector #2152: Fixed MailHost documentation; simple_send does not
         process or validate its arguments in any way.
 
-      - Collector #2175: ZTUtils.make_hidden_input did not escape double-quotes.
+      - Collector #2175: ZTUtils.make_hidden_input did not escape
+        double-quotes.
 
       - Collector #2176: Fixed bad logging call.
 

Modified: Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py
===================================================================
--- Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py	2006-11-01 14:29:33 UTC (rev 71017)
+++ Zope/branches/2.10/lib/python/Products/PageTemplates/ZopePageTemplate.py	2006-11-01 14:37:13 UTC (rev 71018)
@@ -79,6 +79,7 @@
 
     func_defaults = None
     func_code = FuncCode((), 0)
+    strict = False
 
     _default_bindings = {'name_subpath': 'traverse_subpath'}
     _default_content_fn = os.path.join(package_home(globals()),

Modified: Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
===================================================================
--- Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py	2006-11-01 14:29:33 UTC (rev 71017)
+++ Zope/branches/2.10/lib/python/Products/PageTemplates/tests/testZopePageTemplate.py	2006-11-01 14:37:13 UTC (rev 71018)
@@ -40,7 +40,7 @@
         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 @@
         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):



More information about the Checkins mailing list