def test_locked_icon(self): request = self.app.REQUEST self.setRoles(['Manager', 'Member']) self.portal.invokeFactory('Document', 'd1') context = getattr(self.portal, 'd1') viewlet = DocumentBylineViewlet(context, request, None, None) viewlet.update() self.assertEqual(viewlet.locked_icon(), "") ILockable(context).lock() lockIconUrl = '<img src="http://nohost/plone/lock_icon.png" alt="" \ title="Locked" height="16" width="16" />' self.assertEqual(viewlet.locked_icon(), lockIconUrl)
def test_locked_icon(self): request = self.app.REQUEST self.setRoles(['Manager', 'Member']) self.portal.invokeFactory('Document', 'd1') context = getattr(self.portal, 'd1') viewlet = DocumentBylineViewlet(context, request, None, None) viewlet.update() self.assertEqual(viewlet.locked_icon(), "") ILockable(context).lock() lockIconUrl = '<img src="http://nohost/plone/lock_icon.png" alt="" \ title="Locked" height="16" width="16" />' self.assertEqual(viewlet.locked_icon(), lockIconUrl)
def test_anonymous_locked_icon(self): request = self.app.REQUEST self.setRoles(['Manager', 'Member']) self.portal.invokeFactory('Document', 'd1') context = getattr(self.portal, 'd1') viewlet = DocumentBylineViewlet(context, request, None, None) viewlet.update() ILockable(context).lock() self.login('Ano') viewlet = DocumentBylineViewlet(context, request, None, None) viewlet.update() self.assertEqual(viewlet.locked_icon(), "")
def test_anonymous_locked_icon(self): request = self.app.REQUEST self.setRoles(['Manager', 'Member']) self.portal.invokeFactory('Document', 'd1') context = getattr(self.portal, 'd1') viewlet = DocumentBylineViewlet(context, request, None, None) viewlet.update() ILockable(context).lock() self.login('Ano') viewlet = DocumentBylineViewlet(context, request, None, None) viewlet.update() self.assertEqual(viewlet.locked_icon(), "")