[CMF-checkins] SVN: CMF/branches/2.0/C CMFCore.FSDTMLMethod: Add class-default '_owner', to prevent unintended

Tres Seaver tseaver at palladion.com
Mon Aug 14 11:14:34 EDT 2006


Log message for revision 69476:
  CMFCore.FSDTMLMethod: Add class-default '_owner', to prevent unintended
  acquisition of ownership.
  
  See http://www.zope.org/Collectors/CMF/450
  
  

Changed:
  U   CMF/branches/2.0/CHANGES.txt
  U   CMF/branches/2.0/CMFCore/FSDTMLMethod.py
  U   CMF/branches/2.0/CMFCore/tests/test_FSDTMLMethod.py

-=-
Modified: CMF/branches/2.0/CHANGES.txt
===================================================================
--- CMF/branches/2.0/CHANGES.txt	2006-08-14 14:58:29 UTC (rev 69475)
+++ CMF/branches/2.0/CHANGES.txt	2006-08-14 15:14:34 UTC (rev 69476)
@@ -2,6 +2,9 @@
 
   Bug Fixes
 
+    - CMFCore.FSDTMLMethod: Add class-default '_owner', to prevent unintended
+      acquisition of ownership (http://www.zope.org/Collectors/CMF/450)
+
     - CMFCore.CatalogTool: Added 'cmf_uid' method to IndexableObjectWrapper
       so that CMFUid UIDs are not acquired during indexing.
       (http://www.zope.org/Collectors/CMF/446)

Modified: CMF/branches/2.0/CMFCore/FSDTMLMethod.py
===================================================================
--- CMF/branches/2.0/CMFCore/FSDTMLMethod.py	2006-08-14 14:58:29 UTC (rev 69475)
+++ CMF/branches/2.0/CMFCore/FSDTMLMethod.py	2006-08-14 15:14:34 UTC (rev 69476)
@@ -41,6 +41,7 @@
     modifiable from the management interface."""
 
     meta_type = 'Filesystem DTML Method'
+    _owner = None
 
     manage_options=(
         (

Modified: CMF/branches/2.0/CMFCore/tests/test_FSDTMLMethod.py
===================================================================
--- CMF/branches/2.0/CMFCore/tests/test_FSDTMLMethod.py	2006-08-14 14:58:29 UTC (rev 69475)
+++ CMF/branches/2.0/CMFCore/tests/test_FSDTMLMethod.py	2006-08-14 15:14:34 UTC (rev 69476)
@@ -69,6 +69,18 @@
         self.failUnless( 'foo' in self.RESPONSE.headers.keys() )
         self.failUnless( 'bar' in self.RESPONSE.headers.keys() )
 
+    def test_ownership( self ):
+        script = self._makeOne( 'testDTML', 'testDTML.dtml' )
+        script = script.__of__(self.root)
+        # fsdtmlmethod has no owner
+        owner_tuple = script.getOwnerTuple()
+        self.assertEqual(owner_tuple, None)
+
+        # and ownership is not acquired [CMF/450]
+        self.root._owner= ('/foobar', 'baz')
+        owner_tuple = script.getOwnerTuple()
+        self.assertEqual(owner_tuple, None)
+
     def test_304_response_from_cpm( self ):
         # test that we get a 304 response from the cpm via this template
 



More information about the CMF-checkins mailing list