Skip to content

Commit

Permalink
remove archetypes specific code from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Apr 30, 2022
1 parent e2d3829 commit 330d85c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 227 deletions.
10 changes: 6 additions & 4 deletions plone/app/contentmenu/menu.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from AccessControl import getSecurityManager
from Acquisition import aq_base
from Acquisition import aq_inner
from Acquisition import aq_parent
from html import escape
from operator import itemgetter
from plone.app.content.browser.folderfactories import _allowedTypes
Expand Down Expand Up @@ -71,7 +73,7 @@ def __init__(self, context, request):
def action(self):
folder = self.context
if not self.context_state.is_structural_folder():
folder = utils.parent(self.context)
folder = aq_parent(aq_inner(self.context))
return folder.absolute_url() + "/folder_contents"

@memoize
Expand Down Expand Up @@ -187,7 +189,7 @@ def available(self):

# If this is a default page, also get menu items relative to the parent
if isDefaultPage:
folder = ISelectableBrowserDefault(utils.parent(self.context), None)
folder = ISelectableBrowserDefault(aq_parent(aq_inner(self.context)), None)

if folder is not None:
if folder.canSetDefaultPage():
Expand Down Expand Up @@ -222,7 +224,7 @@ def disabled(self):
# if its folder_contents
context = self.context
if self.context_state.is_default_page():
context = utils.parent(context)
context = aq_parent(aq_inner(context))
if not getattr(context, "isPrincipiaFolderish", False):
return False
elif "index_html" not in context:
Expand All @@ -245,7 +247,7 @@ def getMenuItems(self, obj, request):
if isDefaultPage:
# If this is a default page, also get menu items relative to thr
# parent
parent = utils.parent(obj)
parent = aq_parent(aq_inner(obj))
folder = ISelectableBrowserDefault(parent, None)

folderLayouts = []
Expand Down
Loading

0 comments on commit 330d85c

Please sign in to comment.