[Testbot] Plone 4.3 - Python 2.6 - Build # 2739 - Still failing! - 1 failure(s)

jenkins at plone.org jenkins at plone.org
Tue Feb 24 10:24:36 UTC 2015


-------------------------------------------------------------------------------
Plone 4.3 - Python 2.6 - Build # 2739 - Still Failing!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-4.3-python-2.6/2739/


-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------

Repository: Products.CMFPlone
Branch: refs/heads/4.3.x
Date: 2015-02-24T10:51:59+01:00
Author: Timo Stollenwerk () <contact at timostollenwerk.net>
Commit: https://github.com/plone/Products.CMFPlone/commit/38b8474d6c3b51e390aa6b3e20663a8eafe9d6e9

Revert "add tests for https://dev.plone.org/ticket/13603"

This reverts commit 80b687fa2b99da528f77688c0e7fb45a88f3701c.

Files changed:
M Products/CMFPlone/tests/test_ploneutils.py
M docs/CHANGES.rst

diff --git a/Products/CMFPlone/tests/test_ploneutils.py b/Products/CMFPlone/tests/test_ploneutils.py
index a4cb95f..461c71b 100644
--- a/Products/CMFPlone/tests/test_ploneutils.py
+++ b/Products/CMFPlone/tests/test_ploneutils.py
@@ -1,9 +1,6 @@
 import unittest
-import re
 
 from Products.CMFPlone.testing import PRODUCTS_CMFPLONE_INTEGRATION_TESTING
-from plone.app.testing import setRoles
-from plone.app.testing import TEST_USER_ID
 
 
 class TestPloneTool(unittest.TestCase):
@@ -29,83 +26,19 @@ def test_deleteObjectsByPaths_relative_path_raises(self):
             handle_errors=False
         )
 
-    def test_delete_wrongly_acquired_object_through_deleteObjectsByPaths(self):
+    def test_deleteObjectsByPaths_wrongly_acquired_object(self):
         '''
-        Do not delete wrongly acquired object through folder_contents
+        Do not delete wrongly acquired object.
         See https://dev.plone.org/ticket/13603
-
         '''
-        # prepare content
-        self.portal.invokeFactory('Document', 'a_page')
+        self.portal.invokeFactory('Folder', 'a_page')
         self.assertTrue('a_page' in self.portal.objectIds())
-        self.portal.invokeFactory('Folder', 'a_folder')
-        a_folder = self.portal['a_folder']
-        a_folder.invokeFactory('Document', 'a_page')
-        self.assertTrue('a_page' in a_folder.objectIds())
-        a_page_in_folder = a_folder['a_page']
-        path = a_page_in_folder.absolute_url_path()
-
-        # first request to delete
+        a_page_folder = self.portal['a_page']
+        a_page_folder.invokeFactory('Document', 'a_page')
+        self.assertTrue('a_page' in a_page_folder.objectIds())
+        a_page = a_page_folder['a_page']
+        path = a_page.absolute_url_path()
         self.plone_utils.deleteObjectsByPaths([path])
-        self.assertFalse('a_page' in a_folder.objectIds())
-        self.assertTrue('a_page' in self.portal.objectIds())
-
-        # second request to delete
+        self.assertFalse('a_page' in a_page_folder.objectIds())
         self.plone_utils.deleteObjectsByPaths([path])
-        self.assertTrue(
-            'a_page' in self.portal.objectIds(),
-            'acquired content should not be deleted.'
-        )
-
-    def _get_authenticator(self):
-        url = '/plone/login_password'
-        login = self.portal.restrictedTraverse(url)
-        res = login()
-        m = re.search('name="_authenticator" value="([^"]*)"', res)
-        if m:
-            return m.group(1)
-        return ''
-
-    def test_delete_wrongly_acquired_object_through_object_delete(self):
-        '''
-        Do not delete wrongly acquired object through Actions Delete.
-        See https://dev.plone.org/ticket/13603
-        '''
-        setRoles(self.portal, TEST_USER_ID, ['Member', 'Manager'])
-
-        # prepare content
-        self.portal.invokeFactory('Document', 'a_page')
         self.assertTrue('a_page' in self.portal.objectIds())
-        self.portal.invokeFactory('Folder', 'a_folder')
-        a_folder = self.portal['a_folder']
-        a_folder.invokeFactory('Document', 'a_page')
-        self.assertTrue('a_page' in a_folder.objectIds())
-        a_page_in_folder = a_folder['a_page']
-
-        # prepare fake request
-        physical_path = list(a_page_in_folder.getPhysicalPath())
-        physical_path.append('object_delete')
-        url = '/'.join(physical_path)
-        request = self.layer['request']
-        request.set('URL', url)
-        url2 = '/'.join(physical_path[:-2])
-        request.set('URL2', url2)
-        request.environ['REQUEST_METHOD'] = 'POST'
-        csrf_token = self._get_authenticator()
-        request.form.update({
-            '_authenticator': csrf_token,
-        })
-
-        # simulate call to object_delete
-        object_delete = self.portal.restrictedTraverse(url)
-        object_delete()
-        self.assertFalse('a_page' in a_folder.objectIds())
-        self.assertTrue('a_page' in self.portal.objectIds())
-
-        # simulate second call to object_delete
-        object_delete = self.portal.restrictedTraverse(url)
-        object_delete()
-        self.assertTrue(
-            'a_page' in self.portal.objectIds(),
-            'acquired content should not be deleted.'
-        )
diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst
index 8ff990e..7cdc1fc 100644
--- a/docs/CHANGES.rst
+++ b/docs/CHANGES.rst
@@ -8,11 +8,6 @@ Changelog
 4.3.5 (unreleased)
 ------------------
 
-- Fix: If a user "deletes" the same item twice (ex.: having two different tabs 
-  open and not realising it's already been deleted) any higher level item with 
-  the same short name will be deleted without trace. 
-  [gotcha]
-
 - Extended ulocalized_time for target_language
   [agitator]
 


Repository: Products.CMFPlone
Branch: refs/heads/4.3.x
Date: 2015-02-24T10:52:16+01:00
Author: Timo Stollenwerk () <contact at timostollenwerk.net>
Commit: https://github.com/plone/Products.CMFPlone/commit/d29f3f4808575620c5fe5216487a17616735f1d4

Revert "fix for https://dev.plone.org/ticket/13603"

This reverts commit 371cee9e15a996660924045fb061a185af837e42.

This commit broke the 4.3 build: http://jenkins.plone.org/job/plone-4.3-python-2.7/2940/

Files changed:
M Products/CMFPlone/skins/plone_scripts/object_delete.cpy

diff --git a/Products/CMFPlone/skins/plone_scripts/object_delete.cpy b/Products/CMFPlone/skins/plone_scripts/object_delete.cpy
index 0399472..b5e4673 100644
--- a/Products/CMFPlone/skins/plone_scripts/object_delete.cpy
+++ b/Products/CMFPlone/skins/plone_scripts/object_delete.cpy
@@ -18,9 +18,7 @@ REQUEST = context.REQUEST
 if REQUEST.get('REQUEST_METHOD', 'GET').upper() == 'GET':
     raise Unauthorized('This method can not be accessed using a GET request')
 
-parent_path = '/'.join(REQUEST.physicalPathFromURL(REQUEST.URL2))
-parent = context.restrictedTraverse(parent_path)
-
+parent = context.aq_inner.aq_parent
 title = safe_unicode(context.title_or_id())
 
 try:
@@ -37,15 +35,6 @@ else:
     authenticator = context.restrictedTraverse('@@authenticator', None)
     if not authenticator.verify():
         raise Forbidden
-
-    id = context.getId()
-    item = parent.get(id, parent)
-    if item == parent:
-        message = _(u'${title} does not exist and cannot be deleted.',
-                    mapping={u'title': title})
-        context.plone_utils.addPortalMessage(message, type='error')
-        return state.set(status='failure')
-
     parent.manage_delObjects(context.getId())
     message = _(u'${title} has been deleted.',
                 mapping={u'title': title})




-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 7031 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20150224/b9f580c8/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 93833 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20150224/b9f580c8/attachment-0003.obj>


More information about the Testbot mailing list