Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def setField
def testTitleField
def testSubjectField
def testEffectiveDateField
def testLanguageField
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 utils
 doc

Detailed Description

This feature should probably go away entirely.

Definition at line 491 of file testPloneTool.py.


Member Function Documentation

Definition at line 495 of file testPloneTool.py.

00495 
00496     def afterSetUp(self):
00497         self.utils = self.portal.plone_utils
00498         self.folder.invokeFactory('Document', id='doc')
00499         self.doc = self.folder.doc

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.testPloneTool.TestFormulatorFields.setField (   self,
  name,
  value 
)

Definition at line 500 of file testPloneTool.py.

00500 
00501     def setField(self, name, value):
00502         form = self.app.REQUEST.form
00503         pfx = self.utils.field_prefix
00504         form[pfx+name] = value

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 515 of file testPloneTool.py.

00515 
00516     def testEffectiveDateField(self):
00517         self.setField('effective_date', '2001-01-01')
00518         self.utils.editMetadata(self.doc)
00519         self.assertEqual(self.doc.EffectiveDate(zone='UTC'), '2001-01-01 00:00:00')

Here is the call graph for this function:

Definition at line 520 of file testPloneTool.py.

00520 
00521     def testLanguageField(self):
00522         self.setField('language', 'de')
00523         self.utils.editMetadata(self.doc)
00524         # TODO: Note that language, format, and rights do not 
00525         #      receive the Formulator treatment.
00526         self.assertEqual(self.doc.Language(), '')
00527 

Here is the call graph for this function:

Definition at line 510 of file testPloneTool.py.

00510 
00511     def testSubjectField(self):
00512         self.setField('subject', ['Foo', 'Bar', 'Baz'])
00513         self.utils.editMetadata(self.doc)
00514         self.assertEqual(self.doc.Subject(), ('Foo', 'Bar', 'Baz'))

Here is the call graph for this function:

Definition at line 505 of file testPloneTool.py.

00505 
00506     def testTitleField(self):
00507         self.setField('title', 'Foo')
00508         self.utils.editMetadata(self.doc)
00509         self.assertEqual(self.doc.Title(), 'Foo')

Here is the call graph for this function:


Member Data Documentation

Definition at line 498 of file testPloneTool.py.

Definition at line 496 of file testPloneTool.py.


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