Skip to content

Commit

Permalink
Added tests for fix to nav portlet scenario of ticket#11189.
Browse files Browse the repository at this point in the history
  • Loading branch information
fulv committed Nov 19, 2011
1 parent f982496 commit 1c081b5
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions plone/app/portlets/tests/test_navigation_portlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,23 @@ def testCreateNavTreeWithLink(self):
tree = view.getNavTree()
for child in tree['children']:
if child['portal_type'] != 'Link':
self.failIf(child['item'].getRemoteUrl)
self.failIf(child['getRemoteUrl'])
if child['Title'] == 'link1':
self.failUnlessEqual(child['item'].getRemoteUrl, 'http://plone.org')
self.failUnlessEqual(child['getRemoteUrl'], 'http://plone.org')
# as Creator, link1 should not use the remote Url
self.failIf(child['useRemoteUrl'])

self.portal.link1.setCreators(['some_other_user'])
self.portal.link1.reindexObject()
view = self.renderer(self.portal)
tree = view.getNavTree()
for child in tree['children']:
if child['portal_type'] != 'Link':
self.failIf(child['getRemoteUrl'])
if child['Title'] == 'link1':
self.failUnlessEqual(child['getRemoteUrl'], 'http://plone.org')
# as non-Creator user, link1 should use the remote Url
self.failUnless(child['useRemoteUrl'])

def testNonStructuralFolderHidesChildren(self):
# Make sure NonStructuralFolders act as if parentMetaTypesNotToQuery
Expand Down

0 comments on commit 1c081b5

Please sign in to comment.