Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testSortObjectsDefault
def testSortObjectById
def testSortObjectsIsCaseInsensitive
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 items
 items2

Detailed Description

Definition at line 9 of file testSortObjects.py.


Member Function Documentation

Definition at line 11 of file testSortObjects.py.

00011 
00012     def afterSetUp(self):
00013         self.items = [
00014             dummy.Item('d', 'fred'),
00015             dummy.Item('c', 'wilma'),
00016             dummy.Item('b', 'barney'),
00017             dummy.Item('a', 'betty'),
00018         ]
00019         self.items2 = [
00020             dummy.Item('D', 'Fred'),
00021             dummy.Item('c', 'Wilma'),
00022             dummy.Item('B', 'barney'),
00023             dummy.Item('a', 'betty'),
00024         ]

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 30 of file testSortObjects.py.

00030 
00031     def testSortObjectById(self):
00032         # Sorts by passed in method
00033         sorted = self.portal.sortObjects(self.items, 'getId')
00034         self.assertEqual([x.getId() for x in sorted], ['a', 'b', 'c', 'd'])

Definition at line 25 of file testSortObjects.py.

00025 
00026     def testSortObjectsDefault(self):
00027         # Sorts by title_or_id by default
00028         sorted = self.portal.sortObjects(self.items)
00029         self.assertEqual([x.getId() for x in sorted], ['b', 'a', 'd', 'c'])

Definition at line 35 of file testSortObjects.py.

00035 
00036     def testSortObjectsIsCaseInsensitive(self):
00037         # Sorts by passed in method
00038         sorted = self.portal.sortObjects(self.items2, 'getId')
00039         self.assertEqual([x.getId() for x in sorted], ['a', 'B', 'c', 'D'])
00040 


Member Data Documentation

Definition at line 12 of file testSortObjects.py.

Definition at line 18 of file testSortObjects.py.


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