def test_getMembersFolder(self): portal = self.layer['portal'] folder = self._make_one() members = getMembersFolder(portal) self.assertNotEqual(members, None) self.assertEqual(members.getId(), folder.getId()) self.assertEqual(members.absolute_url(), 'http://nohost/plone/members') portal._delObject('members') self.assertEqual(getMembersFolder(portal), None)
def update(self): context = self.context # ignore the update method from PathBarViewlet on purpose super(PathBarViewlet, self).update() self.is_rtl = False folder = getMembersFolder(context) folder_url = folder.absolute_url() result = [{'Title': folder.Title(), 'absolute_url': folder_url}] mtool = getToolByName(context, "portal_membership") member = mtool.getAuthenticatedMember() userid = member.getId() fullname = get_fullname(context, userid) # the last segment is no link - so we don't need to calculate it result.append({'Title': fullname, 'absolute_url': ''}) self.breadcrumbs = result