Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testSetTitle
def testClearTitle
def testSetDescription
def testClearDescription
def testSetSubject
def testClearSubject
def testSetContributors
def testClearContributors
def testSetFormat
def testClearFormat
def testSetLanguage
def testClearLanguage
def testSetRights
def testClearRights
def testSetEffectiveDate
def testClearEffectiveDate
def testSetExpirationDate
def testClearExpirationDate
def testTuplifySubject_1
def testTuplifySubject_2
def DISABLED_testTuplifySubject_3
def testTuplifyContributors_1
def testTuplifyContributors_2
def DISABLED_testTuplifyContributors_3
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 utils
 doc

Detailed Description

Definition at line 275 of file testPloneTool.py.


Member Function Documentation

Definition at line 277 of file testPloneTool.py.

00277 
00278     def afterSetUp(self):
00279         self.utils = self.portal.plone_utils
00280         self.folder.invokeFactory('Document', id='doc')
00281         self.doc = self.folder.doc

Definition at line 414 of file testPloneTool.py.

00414 
00415     def DISABLED_testTuplifyContributors_3(self):
00416         self.utils.editMetadata(self.doc, contributors='Foo; Bar; Baz')
00417         # TODO: Wishful thinking
00418         self.assertEqual(self.doc.Contributors(), ('Foo', 'Bar', 'Baz'))
00419 

Definition at line 400 of file testPloneTool.py.

00400 
00401     def DISABLED_testTuplifySubject_3(self):
00402         self.utils.editMetadata(self.doc, subject='Foo, Bar, Baz')
00403         # TODO: Wishful thinking
00404         self.assertEqual(self.doc.Subject(), ('Foo', 'Bar', 'Baz'))

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

00320 
00321     def testClearContributors(self):
00322         self.utils.editMetadata(self.doc, contributors=['Foo'])
00323         self.assertEqual(self.doc.Contributors(), ('Foo',))
00324         self.utils.editMetadata(self.doc, contributors=[])
00325         self.assertEqual(self.doc.Contributors(), ())

Definition at line 298 of file testPloneTool.py.

00298 
00299     def testClearDescription(self):
00300         self.utils.editMetadata(self.doc, description='Foo')
00301         self.assertEqual(self.doc.Description(), 'Foo')
00302         self.utils.editMetadata(self.doc, description='')
00303         self.assertEqual(self.doc.Description(), '')

Definition at line 370 of file testPloneTool.py.

00370 
00371     def testClearEffectiveDate(self):
00372         self.utils.editMetadata(self.doc, effective_date='2001-01-01')
00373         self.assertEqual(self.doc.EffectiveDate(zone='UTC'), '2001-01-01 00:00:00')
00374         self.utils.editMetadata(self.doc, effective_date='None')
00375         self.assertEqual(self.doc.EffectiveDate(), 'None')
00376         self.assertEqual(self.doc.effective_date, None)

Definition at line 382 of file testPloneTool.py.

00382 
00383     def testClearExpirationDate(self):
00384         self.utils.editMetadata(self.doc, expiration_date='2001-01-01')
00385         self.assertEqual(self.doc.ExpirationDate(zone='UTC'), '2001-01-01 00:00:00')
00386         self.utils.editMetadata(self.doc, expiration_date='None')
00387         self.assertEqual(self.doc.ExpirationDate(), 'None')
00388         self.assertEqual(self.doc.expiration_date, None)

Definition at line 333 of file testPloneTool.py.

00333 
00334     def testClearFormat(self):
00335         self.utils.editMetadata(self.doc, format='text/x-rst')
00336         self.assertEqual(self.doc.Format(), 'text/x-rst')
00337         self.assertEqual(self.doc.text_format, 'text/x-rst')
00338         self.utils.editMetadata(self.doc, format='')
00339         self.assertEqual(self.doc.Format(), 'text/html')
00340         self.assertEqual(self.doc.text_format, 'text/html')

Definition at line 346 of file testPloneTool.py.

00346 
00347     def testClearLanguage(self):
00348         self.utils.editMetadata(self.doc, language='de')
00349         self.assertEqual(self.doc.Language(), 'de')
00350         self.utils.editMetadata(self.doc, language='')
00351         self.assertEqual(self.doc.Language(), '')

Definition at line 357 of file testPloneTool.py.

00357 
00358     def testClearRights(self):
00359         self.utils.editMetadata(self.doc, rights='Foo')
00360         self.assertEqual(self.doc.Rights(), 'Foo')
00361         self.utils.editMetadata(self.doc, rights='')
00362         self.assertEqual(self.doc.Rights(), '')

Definition at line 309 of file testPloneTool.py.

00309 
00310     def testClearSubject(self):
00311         self.utils.editMetadata(self.doc, subject=['Foo'])
00312         self.assertEqual(self.doc.Subject(), ('Foo',))
00313         self.utils.editMetadata(self.doc, subject=[])
00314         self.assertEqual(self.doc.Subject(), ())

Definition at line 287 of file testPloneTool.py.

00287 
00288     def testClearTitle(self):
00289         self.utils.editMetadata(self.doc, title='Foo')
00290         self.assertEqual(self.doc.Title(), 'Foo')
00291         self.utils.editMetadata(self.doc, title='')
00292         self.assertEqual(self.doc.Title(), '')

Definition at line 315 of file testPloneTool.py.

00315 
00316     def testSetContributors(self):
00317         self.assertEqual(self.doc.Contributors(), ())
00318         self.utils.editMetadata(self.doc, contributors=['Foo'])
00319         self.assertEqual(self.doc.Contributors(), ('Foo',))

Definition at line 293 of file testPloneTool.py.

00293 
00294     def testSetDescription(self):
00295         self.assertEqual(self.doc.Description(), '')
00296         self.utils.editMetadata(self.doc, description='Foo')
00297         self.assertEqual(self.doc.Description(), 'Foo')

Definition at line 365 of file testPloneTool.py.

00365 
00366     def testSetEffectiveDate(self):
00367         self.assertEqual(self.doc.EffectiveDate(), 'None')
00368         self.utils.editMetadata(self.doc, effective_date='2001-01-01')
00369         self.assertEqual(self.doc.EffectiveDate(zone='UTC'), '2001-01-01 00:00:00')

Definition at line 377 of file testPloneTool.py.

00377 
00378     def testSetExpirationDate(self):
00379         self.assertEqual(self.doc.ExpirationDate(), 'None')
00380         self.utils.editMetadata(self.doc, expiration_date='2001-01-01')
00381         self.assertEqual(self.doc.ExpirationDate(zone='UTC'), '2001-01-01 00:00:00')

Definition at line 326 of file testPloneTool.py.

00326 
00327     def testSetFormat(self):
00328         self.assertEqual(self.doc.Format(), 'text/html')
00329         self.assertEqual(self.doc.text_format, 'text/html')
00330         self.utils.editMetadata(self.doc, format='text/x-rst')
00331         self.assertEqual(self.doc.Format(), 'text/x-rst')
00332         self.assertEqual(self.doc.text_format, 'text/x-rst')

Definition at line 341 of file testPloneTool.py.

00341 
00342     def testSetLanguage(self):
00343         self.assertEqual(self.doc.Language(), '')
00344         self.utils.editMetadata(self.doc, language='de')
00345         self.assertEqual(self.doc.Language(), 'de')

Definition at line 352 of file testPloneTool.py.

00352 
00353     def testSetRights(self):
00354         self.assertEqual(self.doc.Rights(), '')
00355         self.utils.editMetadata(self.doc, rights='Foo')
00356         self.assertEqual(self.doc.Rights(), 'Foo')

Definition at line 304 of file testPloneTool.py.

00304 
00305     def testSetSubject(self):
00306         self.assertEqual(self.doc.Subject(), ())
00307         self.utils.editMetadata(self.doc, subject=['Foo'])
00308         self.assertEqual(self.doc.Subject(), ('Foo',))

Definition at line 282 of file testPloneTool.py.

00282 
00283     def testSetTitle(self):
00284         self.assertEqual(self.doc.Title(), '')
00285         self.utils.editMetadata(self.doc, title='Foo')
00286         self.assertEqual(self.doc.Title(), 'Foo')

Definition at line 405 of file testPloneTool.py.

00405 
00406     def testTuplifyContributors_1(self):
00407         self.utils.editMetadata(self.doc, contributors=['Foo', 'Bar', 'Baz'])
00408         self.assertEqual(self.doc.Contributors(), ('Foo', 'Bar', 'Baz'))

Definition at line 409 of file testPloneTool.py.

00409 
00410     def testTuplifyContributors_2(self):
00411         self.utils.editMetadata(self.doc, contributors=['Foo', '', 'Bar', 'Baz'])
00412         # Note that empty entries are filtered
00413         self.assertEqual(self.doc.Contributors(), ('Foo', 'Bar', 'Baz'))

Definition at line 391 of file testPloneTool.py.

00391 
00392     def testTuplifySubject_1(self):
00393         self.utils.editMetadata(self.doc, subject=['Foo', 'Bar', 'Baz'])
00394         self.assertEqual(self.doc.Subject(), ('Foo', 'Bar', 'Baz'))

Definition at line 395 of file testPloneTool.py.

00395 
00396     def testTuplifySubject_2(self):
00397         self.utils.editMetadata(self.doc, subject=['Foo', '', 'Bar', 'Baz'])
00398         # Note that empty entries are filtered
00399         self.assertEqual(self.doc.Subject(), ('Foo', 'Bar', 'Baz'))


Member Data Documentation

Definition at line 280 of file testPloneTool.py.

Definition at line 278 of file testPloneTool.py.


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