Back to index

plone3  3.1.7
Public Member Functions
plone.app.layout.viewlets.tests.test_content.TestDocumentBylineViewletView Class Reference
Inheritance diagram for plone.app.layout.viewlets.tests.test_content.TestDocumentBylineViewletView:
Inheritance graph
[legend]
Collaboration diagram for plone.app.layout.viewlets.tests.test_content.TestDocumentBylineViewletView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_anonymous_locked_icon
def test_locked_icon

Detailed Description

Test the document by line viewlet

Definition at line 7 of file test_content.py.


Member Function Documentation

Definition at line 11 of file test_content.py.

00011 
00012     def afterSetUp(self):
00013         addMember(self, 'Alan', roles=('Member', 'Manager'))
00014         addMember(self, 'Ano', roles=())

Definition at line 15 of file test_content.py.

00015 
00016     def test_anonymous_locked_icon(self):
00017         request = self.app.REQUEST
00018         self.setRoles(['Manager', 'Member'])
00019         self.portal.invokeFactory('Document', 'd1')
00020         context = getattr(self.portal, 'd1')
00021         viewlet = DocumentBylineViewlet(context, request, None, None)
00022         viewlet.update()
00023         ILockable(context).lock()
00024         self.login('Ano')
00025         viewlet = DocumentBylineViewlet(context, request, None, None)
00026         viewlet.update()
00027         self.assertEqual(viewlet.locked_icon(), "")

Here is the call graph for this function:

Definition at line 28 of file test_content.py.

00028 
00029     def test_locked_icon(self):
00030         request = self.app.REQUEST
00031         self.setRoles(['Manager', 'Member'])
00032         self.portal.invokeFactory('Document', 'd1')
00033         context = getattr(self.portal, 'd1')
00034         viewlet = DocumentBylineViewlet(context, request, None, None)
00035         viewlet.update()
00036         self.assertEqual(viewlet.locked_icon(), "")
00037         ILockable(context).lock()
00038         self.assertEqual(viewlet.locked_icon(), "")
00039         self.login('Alan')
00040         viewlet = DocumentBylineViewlet(context, request, None, None)
00041         viewlet.update()
00042         lockIconUrl = '<img src="http://nohost/plone/lock_icon.gif" alt="" \
00043 title="Locked" height="16" width="16" />'
00044         self.assertEqual(viewlet.locked_icon(), lockIconUrl)

Here is the call graph for this function:


The documentation for this class was generated from the following file: