Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testPloneView.TestVisibleIdsEnabled Class Reference
Inheritance diagram for CMFPlone.tests.testPloneView.TestVisibleIdsEnabled:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testPloneView.TestVisibleIdsEnabled:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testFailsWithSitePropertyDisabled
def testFailsWithMemberPropertyDisabled
def testSucceedsWithMemberAndSitePropertyEnabled
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 view
 member
 props

Detailed Description

Tests the visibleIdsEnabled method

Definition at line 278 of file testPloneView.py.


Member Function Documentation

Definition at line 281 of file testPloneView.py.

00281 
00282     def afterSetUp(self):
00283         self.view = Plone(self.portal, self.app.REQUEST)
00284         self.member = self.portal.portal_membership.getAuthenticatedMember()
00285         self.props = self.portal.portal_properties.site_properties

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 295 of file testPloneView.py.

00295 
00296     def testFailsWithMemberPropertyDisabled(self):
00297         # Should fail when member property is false
00298         self.member.setProperties(visible_ids=False)
00299         self.props.manage_changeProperties(visible_ids=True)
00300         self.failIf(self.view.visibleIdsEnabled())

Definition at line 286 of file testPloneView.py.

00286 
00287     def testFailsWithSitePropertyDisabled(self):
00288         # Set baseline
00289         self.member.setProperties(visible_ids=False)
00290         self.props.manage_changeProperties(visible_ids=False)
00291         # Should fail when site property is set false
00292         self.failIf(self.view.visibleIdsEnabled())
00293         self.member.setProperties(visible_ids=True)
00294         self.failIf(self.view.visibleIdsEnabled())

Definition at line 301 of file testPloneView.py.

00301 
00302     def testSucceedsWithMemberAndSitePropertyEnabled(self):
00303         # Should succeed only when site property and member property are true
00304         self.props.manage_changeProperties(visible_ids=True)
00305         self.member.setProperties(visible_ids=True)
00306         self.failUnless(self.view.visibleIdsEnabled())


Member Data Documentation

Definition at line 283 of file testPloneView.py.

Definition at line 284 of file testPloneView.py.

Definition at line 282 of file testPloneView.py.


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