Skip to content

Commit

Permalink
Modernize the test testNavigationRootDoesNotOverrideExplicitPath
Browse files Browse the repository at this point in the history
The test was still assuming that the navigation root configuration
is stored in the portal properties while it is in the registry since
quite some time.

Adapt the test to check that nothing breaks when tweaking the registry.

Refs. #125
ale-rt committed Nov 6, 2022
1 parent a382eaf commit 57869c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Products/CMFPlone/tests/testQueryCatalog.py
Original file line number Diff line number Diff line change
@@ -133,10 +133,14 @@ def testNavigationRoot(self):

def testNavigationRootDoesNotOverrideExplicitPath(self):
request = {'SearchableText': 'a*', 'path': '/yyy/zzz'}
ntp = self.portal.portal_properties.navtree_properties
self.setRoles(('Manager',))
self.portal.invokeFactory('Folder', 'foo')
ntp.root = '/foo'
registry = getUtility(IRegistry)
navigation_settings = registry.forInterface(
INavigationSchema,
prefix='plone'
)
navigation_settings.root = '/'
qry = self.folder.queryCatalog(request, use_navigation_root=True)
self.assertEqual('/yyy/zzz', qry['path'])

0 comments on commit 57869c8

Please sign in to comment.