Sanitize test. The __roles__ part is still failing, but I have an idea ;).

parent b32ed0ca
...@@ -218,11 +218,9 @@ so we get ('',) instead of ('eagle',): ...@@ -218,11 +218,9 @@ so we get ('',) instead of ('eagle',):
>>> getattr(view, '__ac_permissions__') >>> getattr(view, '__ac_permissions__')
(('View management screens', ('',)),) (('View management screens', ('',)),)
Wrap into an acquisition so that imPermissionRole objects can be The view's __roles__ attribute can be evaluated correctly:
evaluated. __roles__ is a imPermissionRole object:
>>> view_roles = getattr(view, '__roles__', None) >>> view.__roles__
>>> view_roles
('Manager',) ('Manager',)
Check to see if view's context properly acquires its true Check to see if view's context properly acquires its true
...@@ -236,14 +234,15 @@ Check the wrapper type ...@@ -236,14 +234,15 @@ Check the wrapper type
>>> from Acquisition import ImplicitAcquisitionWrapper >>> from Acquisition import ImplicitAcquisitionWrapper
>>> type(context) == ImplicitAcquisitionWrapper >>> type(context) == ImplicitAcquisitionWrapper
True True
The acquired parent is the view. This isn't
usually what you want.
>>> aq_parent(context) == view The parent of the view is the view's context:
True
To get what you usually want, do this >>> view.__parent__ == view.context
True
>>> aq_parent(view) == view.context
True
The direct parent of the context is
>>> context.aq_inner.aq_parent >>> context.aq_inner.aq_parent
<Folder at /test_folder_1_> <Folder at /test_folder_1_>
......
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