Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testElements
def testHours
def testAM
def testPM
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 d

Detailed Description

Definition at line 319 of file testDateComponentsSupport.py.


Member Function Documentation

Definition at line 321 of file testDateComponentsSupport.py.

00321 
00322     def afterSetUp(self):
00323         date = DateTime(2002, 8, 1, 17, 42, 0)
00324         self.d = self.portal.date_components_support(date, use_ampm=1)

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 350 of file testDateComponentsSupport.py.

00350 
00351     def testAM(self):
00352         d = DateTime(2002, 8, 1, 3, 0, 0)
00353         d = self.portal.date_components_support(d, use_ampm=1)
00354 
00355         data = [
00356             {'selected': None, 'id': '--', 'value': 'AM'},
00357             {'selected': 1,    'id': 'AM',   'value': 'AM'},
00358             {'selected': None, 'id': 'PM',   'value': 'PM'},
00359         ]
00360 
00361         ampm = d.get('ampm')
00362         for i in range(3):
00363             self.assertEqual(ampm[i], data[i])

Definition at line 325 of file testDateComponentsSupport.py.

00325 
00326     def testElements(self):
00327         self.assertEqual(sortTuple(self.d.keys()),
00328                 ('ampm', 'days', 'hours', 'minutes', 'months', 'years'))

Here is the call graph for this function:

Definition at line 329 of file testDateComponentsSupport.py.

00329 
00330     def testHours(self):
00331         data = [
00332             {'selected': None, 'id': '--', 'value': '12'},
00333             {'selected': None, 'id': '12',   'value': '12'},
00334             {'selected': None, 'id': '01',   'value': '01'},
00335             {'selected': None, 'id': '02',   'value': '02'},
00336             {'selected': None, 'id': '03',   'value': '03'},
00337             {'selected': None, 'id': '04',   'value': '04'},
00338             {'selected': 1,    'id': '05',   'value': '05'},
00339             {'selected': None, 'id': '06',   'value': '06'},
00340             {'selected': None, 'id': '07',   'value': '07'},
00341             {'selected': None, 'id': '08',   'value': '08'},
00342             {'selected': None, 'id': '09',   'value': '09'},
00343             {'selected': None, 'id': '10',   'value': '10'},
00344             {'selected': None, 'id': '11',   'value': '11'},
00345         ]
00346 
00347         hours = self.d.get('hours')
00348         for i in range(13):
00349             self.assertEqual(hours[i], data[i])

Definition at line 364 of file testDateComponentsSupport.py.

00364 
00365     def testPM(self):
00366         data = [
00367             {'selected': None, 'id': '--', 'value': 'AM'},
00368             {'selected': None, 'id': 'AM',   'value': 'AM'},
00369             {'selected': 1,    'id': 'PM',   'value': 'PM'},
00370         ]
00371 
00372         ampm = self.d.get('ampm')
00373         for i in range(3):
00374             self.assertEqual(ampm[i], data[i])
00375 


Member Data Documentation

Definition at line 323 of file testDateComponentsSupport.py.


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