Back to index

plone3  3.1.7
Public Member Functions
CMFPlone.tests.testCheckId.TestIsIDAutoGenerated Class Reference
Inheritance diagram for CMFPlone.tests.testCheckId.TestIsIDAutoGenerated:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testCheckId.TestIsIDAutoGenerated:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def testAutoGeneratedId
def testAutoGeneratedIdWithUnderScores
def testEmptyId
def testValidPortalTypeNameButNotAutoGeneratedId
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Detailed Description

Tests the isIDAutoGenerated script

Definition at line 13 of file testCheckId.py.


Member Function Documentation

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 16 of file testCheckId.py.

00016 
00017     def testAutoGeneratedId(self):
00018         plone_utils = getToolByName(self.portal, 'plone_utils')
00019         r = plone_utils.isIDAutoGenerated('document.2004-11-09.0123456789')
00020         self.assertEqual(r, True)

Here is the call graph for this function:

Definition at line 21 of file testCheckId.py.

00021 
00022     def testAutoGeneratedIdWithUnderScores(self):
00023         plone_utils = getToolByName(self.portal, 'plone_utils')
00024         portal_types = getToolByName(self.portal, 'portal_types')
00025         portal_types.test_type=self.portal.portal_types.Event
00026         portal_types.test_type.id="test_type"
00027 
00028         r = plone_utils.isIDAutoGenerated('test_type.2004-11-09.0123456789')
00029 
00030         del portal_types.test_type
00031 
00032         self.assertEqual(r, True)

Here is the call graph for this function:

Definition at line 33 of file testCheckId.py.

00033 
00034     def testEmptyId(self):
00035         plone_utils = getToolByName(self.portal, 'plone_utils')
00036         r = plone_utils.isIDAutoGenerated('')
00037         self.assertEqual(r, False)

Here is the call graph for this function:

Definition at line 38 of file testCheckId.py.

00038 
00039     def testValidPortalTypeNameButNotAutoGeneratedId(self):
00040         plone_utils = getToolByName(self.portal, 'plone_utils')
00041         # This was raising an IndexError exception for
00042         # Zope < 2.7.3 (DateTime.py < 1.85.12.11) and a
00043         # SyntaxError for Zope >= 2.7.3 (DateTime.py >= 1.85.12.11)
00044         r = plone_utils.isIDAutoGenerated('document.tar.gz')
00045         self.assertEqual(r, False)
00046         # check DateError
00047         r = plone_utils.isIDAutoGenerated('document.tar.12/32/2004')
00048         self.assertEqual(r, False)
00049         # check TimeError
00050         r = plone_utils.isIDAutoGenerated('document.tar.12/31/2004 12:62')
00051         self.assertEqual(r, False)
00052 

Here is the call graph for this function:


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