Commit 1952d686 authored by Vincent Pelletier's avatar Vincent Pelletier

testSecurity: Do least intrusive checks before more intrusive ones.

Some underscore-prefixed properties may fail callable() check (ex: because
the document requires some properties set to access an underlying actual
callable).
So give these a chance to be skipped before failing.
parent 830c2efc
......@@ -85,9 +85,8 @@ class TestSecurityMixin(ERP5TypeTestCase):
meta_type_dict[meta_type] = True
if '__roles__' in obj.__class__.__dict__:
continue
method_id_list = [x for x in dir(obj) if callable(getattr(obj, x, None))]
for method_id in method_id_list:
if method_id.startswith('_') or method_id in white_method_id_list:
for method_id in dir(obj):
if method_id.startswith('_') or method_id in white_method_id_list or not callable(getattr(obj, method_id, None)):
continue
method = getattr(obj, method_id)
if isinstance(method, MethodType) and \
......
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