Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def getDefault
def testDefaultPageSetting
def testDefaultPageStringExist
def testDefaultPageStringNotExist
def testDefaultPageSequenceExist
def testDefaultPageSequenceNotExist
def testBrowserDefaultPage
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 ob
 default

Detailed Description

Test the default_page functionality in more detail

Definition at line 202 of file testBrowserDefault.py.


Member Function Documentation

Definition at line 206 of file testBrowserDefault.py.

00206 
00207     def afterSetUp(self):
00208         self.ob = dummy.DefaultPage()
00209         sp = getToolByName(self.portal, "portal_properties").site_properties
00210         self.default = sp.getProperty('default_page', [])

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:

Definition at line 211 of file testBrowserDefault.py.

00211 
00212     def getDefault(self):
00213         return getToolByName(self.portal, "plone_utils").browserDefault(self.ob)

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 245 of file testBrowserDefault.py.

00245 
00246     def testBrowserDefaultPage(self):
00247         # Test assumes ATContentTypes + BrowserDefaultMixin
00248         self.folder.invokeFactory('Document', 'd1', title='document 1')
00249         self.folder.setDefaultPage('d1')
00250         self.assertEquals(self.portal.plone_utils.browserDefault(self.folder),
00251                             (self.folder, ['d1']))

Here is the call graph for this function:

Definition at line 229 of file testBrowserDefault.py.

00229 
00230     def testDefaultPageSequenceExist(self):
00231         # Test for http://dev.plone.org/plone/ticket/2671
00232         self.ob.set_default(['test'], 1)
00233         self.assertEquals(self.getDefault(), (self.ob, ['test']))

Here is the call graph for this function:

Definition at line 234 of file testBrowserDefault.py.

00234 
00235     def testDefaultPageSequenceNotExist(self):
00236         # Test for http://dev.plone.org/plone/ticket/2671
00237         self.ob.set_default(['test'], 0)
00238         self.assertEquals(self.getDefault(), (self.ob, ['index_html']))
00239         self.ob.keys = ['index.html']
00240         self.assertEquals(self.getDefault(), (self.ob, ['index.html']))
00241         self.ob.keys = ['index.htm']
00242         self.assertEquals(self.getDefault(), (self.ob, ['index.htm']))
00243         self.ob.keys = ['FrontPage']
00244         self.assertEquals(self.getDefault(), (self.ob, ['FrontPage']))

Here is the call graph for this function:

Definition at line 214 of file testBrowserDefault.py.

00214 
00215     def testDefaultPageSetting(self):
00216         self.assertEquals(self.default, ('index_html', 'index.html',
00217                                          'index.htm', 'FrontPage'))

Definition at line 218 of file testBrowserDefault.py.

00218 
00219     def testDefaultPageStringExist(self):
00220         # Test for http://dev.plone.org/plone/ticket/2671
00221         self.ob.keys = [] # Make sure 'index_html' fake key doesn't win
00222         self.ob.set_default('test', 1)
00223         self.assertEquals(self.getDefault(), (self.ob, ['test']))

Here is the call graph for this function:

Definition at line 224 of file testBrowserDefault.py.

00224 
00225     def testDefaultPageStringNotExist(self):
00226         # Test for http://dev.plone.org/plone/ticket/2671
00227         self.ob.set_default('test', 0)
00228         self.assertEquals(self.getDefault(), (self.ob, ['index_html']))

Here is the call graph for this function:


Member Data Documentation

Definition at line 209 of file testBrowserDefault.py.

Definition at line 207 of file testBrowserDefault.py.


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