Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testEditTitleOnly
def testEditSubjectOnly
def testEditEffectiveDateOnly
def testEditLanguageOnly
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 utils
 doc

Detailed Description

Definition at line 420 of file testPloneTool.py.


Member Function Documentation

Definition at line 422 of file testPloneTool.py.

00422 
00423     def afterSetUp(self):
00424         self.utils = self.portal.plone_utils
00425         self.folder.invokeFactory('Document', id='doc')
00426         self.doc = self.folder.doc
00427         self.utils.editMetadata(self.doc,
00428                                 title='Foo',
00429                                 subject=('Bar',),
00430                                 description='Baz',
00431                                 contributors=('Fred',),
00432                                 effective_date='2001-01-01',
00433                                 expiration_date='2003-01-01',
00434                                 format='text/html',
00435                                 language='de',
00436                                 rights='Copyleft',
00437                                )

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

00464 
00465     def testEditEffectiveDateOnly(self):
00466         self.utils.editMetadata(self.doc, effective_date='2001-12-31')
00467         self.assertEqual(self.doc.EffectiveDate(zone='UTC'), '2001-12-31 00:00:00')
00468         # Other elements must not change
00469         self.assertEqual(self.doc.Title(), 'Foo')
00470         self.assertEqual(self.doc.Subject(), ('Bar',))
00471         self.assertEqual(self.doc.Description(), 'Baz')
00472         self.assertEqual(self.doc.Contributors(), ('Fred',))
00473         self.assertEqual(self.doc.ExpirationDate(zone='UTC'), '2003-01-01 00:00:00')
00474         self.assertEqual(self.doc.Format(), 'text/html')
00475         self.assertEqual(self.doc.Language(), 'de')
00476         self.assertEqual(self.doc.Rights(), 'Copyleft')

Definition at line 477 of file testPloneTool.py.

00477 
00478     def testEditLanguageOnly(self):
00479         self.utils.editMetadata(self.doc, language='fr')
00480         self.assertEqual(self.doc.Language(), 'fr')
00481         # Other elements must not change
00482         self.assertEqual(self.doc.Title(), 'Foo')
00483         self.assertEqual(self.doc.Subject(), ('Bar',))
00484         self.assertEqual(self.doc.Description(), 'Baz')
00485         self.assertEqual(self.doc.Contributors(), ('Fred',))
00486         self.assertEqual(self.doc.EffectiveDate(zone='UTC'), '2001-01-01 00:00:00')
00487         self.assertEqual(self.doc.ExpirationDate(zone='UTC'), '2003-01-01 00:00:00')
00488         self.assertEqual(self.doc.Format(), 'text/html')
00489         self.assertEqual(self.doc.Rights(), 'Copyleft')
00490 

Definition at line 451 of file testPloneTool.py.

00451 
00452     def testEditSubjectOnly(self):
00453         self.utils.editMetadata(self.doc, subject=('Oh', 'Happy', 'Day'))
00454         self.assertEqual(self.doc.Subject(), ('Oh', 'Happy', 'Day'))
00455         # Other elements must not change
00456         self.assertEqual(self.doc.Title(), 'Foo')
00457         self.assertEqual(self.doc.Description(), 'Baz')
00458         self.assertEqual(self.doc.Contributors(), ('Fred',))
00459         self.assertEqual(self.doc.EffectiveDate(zone='UTC'), '2001-01-01 00:00:00')
00460         self.assertEqual(self.doc.ExpirationDate(zone='UTC'), '2003-01-01 00:00:00')
00461         self.assertEqual(self.doc.Format(), 'text/html')
00462         self.assertEqual(self.doc.Language(), 'de')
00463         self.assertEqual(self.doc.Rights(), 'Copyleft')

Definition at line 438 of file testPloneTool.py.

00438 
00439     def testEditTitleOnly(self):
00440         self.utils.editMetadata(self.doc, title='Oh Happy Day')
00441         self.assertEqual(self.doc.Title(), 'Oh Happy Day')
00442         # Other elements must not change
00443         self.assertEqual(self.doc.Subject(), ('Bar',))
00444         self.assertEqual(self.doc.Description(), 'Baz')
00445         self.assertEqual(self.doc.Contributors(), ('Fred',))
00446         self.assertEqual(self.doc.EffectiveDate(zone='UTC'), '2001-01-01 00:00:00')
00447         self.assertEqual(self.doc.ExpirationDate(zone='UTC'), '2003-01-01 00:00:00')
00448         self.assertEqual(self.doc.Format(), 'text/html')
00449         self.assertEqual(self.doc.Language(), 'de')
00450         self.assertEqual(self.doc.Rights(), 'Copyleft')


Member Data Documentation

Definition at line 425 of file testPloneTool.py.

Definition at line 423 of file testPloneTool.py.


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