Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testElements
def testYears
def testMonths
def testDays
def testHours
def testMinutes
def testAMPM
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 d

Detailed Description

Definition at line 170 of file testDateComponentsSupport.py.


Member Function Documentation

Definition at line 172 of file testDateComponentsSupport.py.

00172 
00173     def afterSetUp(self):
00174         self.d = self.portal.date_components_support(None)

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

00314 
00315     def testAMPM(self):
00316         ampm = self.d.get('ampm')
00317         self.assertEqual(ampm, [])
00318 

Definition at line 220 of file testDateComponentsSupport.py.

00220 
00221     def testDays(self):
00222         data = [
00223             {'selected': 1,    'id': '--', 'value': '00'},
00224             {'selected': None, 'id': 1,      'value': '01'},
00225             {'selected': None, 'id': 2,      'value': '02'},
00226             {'selected': None, 'id': 3,      'value': '03'},
00227             {'selected': None, 'id': 4,      'value': '04'},
00228             {'selected': None, 'id': 5,      'value': '05'},
00229             {'selected': None, 'id': 6,      'value': '06'},
00230             {'selected': None, 'id': 7,      'value': '07'},
00231             {'selected': None, 'id': 8,      'value': '08'},
00232             {'selected': None, 'id': 9,      'value': '09'},
00233             {'selected': None, 'id': 10,     'value': '10'},
00234             {'selected': None, 'id': 11,     'value': '11'},
00235             {'selected': None, 'id': 12,     'value': '12'},
00236             {'selected': None, 'id': 13,     'value': '13'},
00237             {'selected': None, 'id': 14,     'value': '14'},
00238             {'selected': None, 'id': 15,     'value': '15'},
00239             {'selected': None, 'id': 16,     'value': '16'},
00240             {'selected': None, 'id': 17,     'value': '17'},
00241             {'selected': None, 'id': 18,     'value': '18'},
00242             {'selected': None, 'id': 19,     'value': '19'},
00243             {'selected': None, 'id': 20,     'value': '20'},
00244             {'selected': None, 'id': 21,     'value': '21'},
00245             {'selected': None, 'id': 22,     'value': '22'},
00246             {'selected': None, 'id': 23,     'value': '23'},
00247             {'selected': None, 'id': 24,     'value': '24'},
00248             {'selected': None, 'id': 25,     'value': '25'},
00249             {'selected': None, 'id': 26,     'value': '26'},
00250             {'selected': None, 'id': 27,     'value': '27'},
00251             {'selected': None, 'id': 28,     'value': '28'},
00252             {'selected': None, 'id': 29,     'value': '29'},
00253             {'selected': None, 'id': 30,     'value': '30'},
00254             {'selected': None, 'id': 31,     'value': '31'},
00255         ]
00256     
00257         days = self.d.get('days')
00258         for i in range(32):
00259             self.assertEqual(days[i], data[i])

Definition at line 175 of file testDateComponentsSupport.py.

00175 
00176     def testElements(self):
00177         self.assertEqual(sortTuple(self.d.keys()), 
00178                 ('ampm', 'days', 'hours', 'minutes', 'months', 'years'))

Here is the call graph for this function:

Definition at line 260 of file testDateComponentsSupport.py.

00260 
00261     def testHours(self):
00262         data = [
00263             {'selected': 1,    'id': '--', 'value': '00'},
00264             {'selected': None, 'id': '00',   'value': '00'},
00265             {'selected': None, 'id': '01',   'value': '01'},
00266             {'selected': None, 'id': '02',   'value': '02'},
00267             {'selected': None, 'id': '03',   'value': '03'},
00268             {'selected': None, 'id': '04',   'value': '04'},
00269             {'selected': None, 'id': '05',   'value': '05'},
00270             {'selected': None, 'id': '06',   'value': '06'},
00271             {'selected': None, 'id': '07',   'value': '07'},
00272             {'selected': None, 'id': '08',   'value': '08'},
00273             {'selected': None, 'id': '09',   'value': '09'},
00274             {'selected': None, 'id': '10',   'value': '10'},
00275             {'selected': None, 'id': '11',   'value': '11'},
00276             {'selected': None, 'id': '12',   'value': '12'},
00277             {'selected': None, 'id': '13',   'value': '13'},
00278             {'selected': None, 'id': '14',   'value': '14'},
00279             {'selected': None, 'id': '15',   'value': '15'},
00280             {'selected': None, 'id': '16',   'value': '16'},
00281             {'selected': None, 'id': '17',   'value': '17'},
00282             {'selected': None, 'id': '18',   'value': '18'},
00283             {'selected': None, 'id': '19',   'value': '19'},
00284             {'selected': None, 'id': '20',   'value': '20'},
00285             {'selected': None, 'id': '21',   'value': '21'},
00286             {'selected': None, 'id': '22',   'value': '22'},
00287             {'selected': None, 'id': '23',   'value': '23'},
00288         ]
00289 
00290         hours = self.d.get('hours')
00291         for i in range(25):
00292             self.assertEqual(hours[i], data[i])

Definition at line 293 of file testDateComponentsSupport.py.

00293 
00294     def testMinutes(self):
00295         data = [
00296             {'selected': 1,    'id': '--', 'value': '00'},
00297             {'selected': None, 'id': '00',   'value': '00'},
00298             {'selected': None, 'id': '05',   'value': '05'},
00299             {'selected': None, 'id': '10',   'value': '10'},
00300             {'selected': None, 'id': '15',   'value': '15'},
00301             {'selected': None, 'id': '20',   'value': '20'},
00302             {'selected': None, 'id': '25',   'value': '25'},
00303             {'selected': None, 'id': '30',   'value': '30'},
00304             {'selected': None, 'id': '35',   'value': '35'},
00305             {'selected': None, 'id': '40',   'value': '40'},
00306             {'selected': None, 'id': '45',   'value': '45'},
00307             {'selected': None, 'id': '50',   'value': '50'},
00308             {'selected': None, 'id': '55',   'value': '55'},
00309         ]
00310 
00311         minutes = self.d.get('minutes')
00312         for i in range(13):
00313             self.assertEqual(minutes[i], data[i])

Definition at line 199 of file testDateComponentsSupport.py.

00199 
00200     def testMonths(self):
00201         data = [
00202             {'selected': 1,    'id': '--',      'value': '00'},
00203             {'selected': None, 'id': 'January',   'value': '01'},
00204             {'selected': None, 'id': 'February',  'value': '02'},
00205             {'selected': None, 'id': 'March',     'value': '03'},
00206             {'selected': None, 'id': 'April',     'value': '04'},
00207             {'selected': None, 'id': 'May',       'value': '05'},
00208             {'selected': None, 'id': 'June',      'value': '06'},
00209             {'selected': None, 'id': 'July',      'value': '07'},
00210             {'selected': None, 'id': 'August',    'value': '08'},
00211             {'selected': None, 'id': 'September', 'value': '09'},
00212             {'selected': None, 'id': 'October',   'value': '10'},
00213             {'selected': None, 'id': 'November',  'value': '11'},
00214             {'selected': None, 'id': 'December',  'value': '12'},
00215         ]
00216 
00217         months = self.d.get('months')
00218         for i in range(13):
00219             self.assertEqual(months[i], data[i])

Definition at line 179 of file testDateComponentsSupport.py.

00179 
00180     def testYears(self):
00181         this_year = DateTime().year()
00182         site_properties = self.portal.portal_properties.site_properties
00183         min_year = site_properties.getProperty('calendar_starting_year', 1999)
00184         max_year = site_properties.getProperty('calendar_future_years_available', 5) + this_year
00185 
00186         data = [
00187             {'selected': None, 'id': '--', 'value': '0000'}
00188         ]
00189 
00190         for y in range(min_year, max_year+1):
00191             d = {'selected': None, 'id': y, 'value': y}
00192             if y == this_year:
00193                 d['selected'] = 1
00194             data.append(d)
00195 
00196         years = self.d.get('years')
00197         for i in range(max_year - min_year + 1):
00198             self.assertEqual(years[i], data[i])


Member Data Documentation

Definition at line 173 of file testDateComponentsSupport.py.


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