SVN: CMF/branches/1.6/C Backport fix for issue #450 from 2.0 branch.

Tres Seaver <[email protected]>
Newsgroups gmane.comp.web.zope.cmf.cvs
Message-ID <[email protected]>
Log message for revision 69479:
  Backport fix for issue #450 from 2.0 branch.

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

-=-
Modified: CMF/branches/1.6/CHANGES.txt
===================================================================
--- CMF/branches/1.6/CHANGES.txt	2006-08-14 15:43:39 UTC (rev 69478)
+++ CMF/branches/1.6/CHANGES.txt	2006-08-14 15:56:27 UTC (rev 69479)
@@ -1,3 +1,10 @@
+After CMF 1.6.2-beta
+
+  Bug Fixes
+
+    - CMFCore.FSDTMLMethod: Add class-default '_owner', to prevent unintended
+      acquisition of ownership (http://www.zope.org/Collectors/CMF/450)
+
 CMF 1.6.2-beta (2006/08/08)
 
   Bug Fixes

Modified: CMF/branches/1.6/CMFCore/FSDTMLMethod.py
===================================================================
--- CMF/branches/1.6/CMFCore/FSDTMLMethod.py	2006-08-14 15:43:39 UTC (rev 69478)
+++ CMF/branches/1.6/CMFCore/FSDTMLMethod.py	2006-08-14 15:56:27 UTC (rev 69479)
@@ -41,6 +41,7 @@
     modifiable from the management interface."""
 
     meta_type = 'Filesystem DTML Method'
+    _owner = None
 
     manage_options=(
         (

Modified: CMF/branches/1.6/CMFCore/tests/test_FSDTMLMethod.py
===================================================================
--- CMF/branches/1.6/CMFCore/tests/test_FSDTMLMethod.py	2006-08-14 15:43:39 UTC (rev 69478)
+++ CMF/branches/1.6/CMFCore/tests/test_FSDTMLMethod.py	2006-08-14 15:56:27 UTC (rev 69479)
@@ -74,6 +74,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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.