Commit 361ee510 authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

BTreeFolder2: do not patch manage_delAllObjects on Zope2

On Zope2 this method does not exist and this caused a test failure

======================================================================
FAIL: test_method_protection (testSecurity.TestSecurity)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "parts/erp5/Products/ERP5/tests/testSecurity.py", line 110, in test_method_protection
    self.fail(message)
AssertionError:
The following 1 methods have a docstring but have no security assertions.
	parts/erp5/product/ERP5Type/patches/BTreeFolder2.py:111 manage_delAllObjects
parent 5daf8a82
......@@ -14,6 +14,7 @@
##############################################################################
# Stribger repair of BTreeFolder2
from Products.ERP5Type import IS_ZOPE2
from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2Base
from Acquisition import aq_base
from BTrees.OOBTree import OOBTree
......@@ -108,11 +109,12 @@ try:
except AttributeError:
pass
def manage_delAllObjects(self, REQUEST=None):
"""Disable dangerous method"""
raise RuntimeError(
"manage_delAllObjects is disabled in ERP5 to protect data from "
"human error. There are unbelievable mistakes. ERP5 is a place "
"to store important data that must not be deleted easily.")
if not IS_ZOPE2:
def manage_delAllObjects(self, REQUEST=None):
"""Disable dangerous method"""
raise RuntimeError(
"manage_delAllObjects is disabled in ERP5 to protect data from "
"human error. There are unbelievable mistakes. ERP5 is a place "
"to store important data that must not be deleted easily.")
BTreeFolder2Base.manage_delAllObjects = manage_delAllObjects
BTreeFolder2Base.manage_delAllObjects = manage_delAllObjects
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