Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testAddDocument
def testPublishDocument
def testRetractDocument
def testEditDocument
def testGetterSkinScript
def testSetterSkinScript
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 catalog
 workflow

Detailed Description

Definition at line 10 of file testPloneTestCase.py.


Member Function Documentation

Definition at line 12 of file testPloneTestCase.py.

00012 
00013     def afterSetUp(self):
00014         self.catalog = self.portal.portal_catalog
00015         self.workflow = self.portal.portal_workflow
00016         self.setupAuthenticator()

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 17 of file testPloneTestCase.py.

00017 
00018     def testAddDocument(self):
00019         self.failIf(self.catalog(id='new'))
00020         self.folder.invokeFactory('Document', id='new')
00021         self.failUnless(hasattr(aq_base(self.folder), 'new'))
00022         self.failUnless(self.catalog(id='new'))

Here is the call graph for this function:

Definition at line 39 of file testPloneTestCase.py.

00039 
00040     def testEditDocument(self):
00041         self.folder.invokeFactory('Document', id='new')
00042         self.assertEqual(self.folder.new.EditableBody(), '')
00043         self.folder.new.edit('plain', 'data', file='', safety_belt='')
00044         self.assertEqual(self.folder.new.EditableBody(), 'data')

Definition at line 45 of file testPloneTestCase.py.

00045 
00046     def testGetterSkinScript(self):
00047         self.folder.invokeFactory('Document', id='new', title='Foo')
00048         self.assertEqual(self.folder.new.TitleOrId(), 'Foo')

Definition at line 23 of file testPloneTestCase.py.

00023 
00024     def testPublishDocument(self):
00025         self.folder.invokeFactory('Document', id='new')
00026         self.setRoles(['Reviewer'])
00027         self.workflow.doActionFor(self.folder.new, 'publish')
00028         self.assertEqual(self.workflow.getInfoFor(self.folder.new, 'review_state'), 'published')
00029         self.failUnless(self.catalog(id='new', review_state='published'))

Here is the call graph for this function:

Definition at line 30 of file testPloneTestCase.py.

00030 
00031     def testRetractDocument(self):
00032         self.folder.invokeFactory('Document', id='new')
00033         self.setRoles(['Reviewer'])
00034         self.workflow.doActionFor(self.folder.new, 'publish')
00035         self.assertEqual(self.workflow.getInfoFor(self.folder.new, 'review_state'), 'published')
00036         self.setRoles(['Member'])
00037         self.workflow.doActionFor(self.folder.new, 'retract')
00038         self.assertEqual(self.workflow.getInfoFor(self.folder.new, 'review_state'), 'visible')

Here is the call graph for this function:

Definition at line 49 of file testPloneTestCase.py.

00049 
00050     def testSetterSkinScript(self):
00051         self.folder.invokeFactory('Document', id='new')
00052         self.assertEqual(self.folder.new.EditableBody(), '')
00053         self.folder.new.document_edit('plain', 'data', title='Foo')
00054         self.assertEqual(self.folder.new.EditableBody(), 'data')
00055 


Member Data Documentation

Definition at line 13 of file testPloneTestCase.py.

Definition at line 14 of file testPloneTestCase.py.


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