Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFTopic.tests.test_SortC.SortCriterionTests Class Reference
Inheritance diagram for CMFTopic.tests.test_SortC.SortCriterionTests:
Inheritance graph
[legend]
Collaboration diagram for CMFTopic.tests.test_SortC.SortCriterionTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_Empty
def test_Nonempty

Private Member Functions

def _getTargetClass

Detailed Description

Definition at line 24 of file test_SortC.py.


Member Function Documentation

Definition at line 26 of file test_SortC.py.

00026 
00027     def _getTargetClass(self):
00028         from Products.CMFTopic.SortCriterion import SortCriterion
00029 
00030         return SortCriterion

Definition at line 31 of file test_SortC.py.

00031 
00032     def test_Empty( self ):
00033         ssc = self._makeOne('foo', 'foofield')
00034 
00035         self.assertEqual( ssc.getId(), 'foo' )
00036         self.assertEqual( ssc.field, None )
00037         self.assertEqual( ssc.index, 'foofield' )
00038         self.assertEqual( ssc.Field(), 'foofield' )
00039         self.assertEqual( ssc.reversed, 0 )
00040 
00041         items = ssc.getCriteriaItems()
00042         self.assertEqual( len( items ), 1 )
00043         self.assertEqual( items[0][0], 'sort_on' )
00044         self.assertEqual( items[0][1], 'foofield' )

Definition at line 45 of file test_SortC.py.

00045 
00046     def test_Nonempty( self ):
00047         ssc = self._makeOne('foo', 'foofield')
00048 
00049         ssc.edit( 1 )
00050 
00051         self.assertEqual( ssc.getId(), 'foo' )
00052         self.assertEqual( ssc.field, None )
00053         self.assertEqual( ssc.index, 'foofield' )
00054         self.assertEqual( ssc.Field(), 'foofield' )
00055         self.assertEqual( ssc.reversed, 1 )
00056 
00057         items = ssc.getCriteriaItems()
00058         self.assertEqual( len( items ), 2 )
00059         self.assertEqual( items[0][0], 'sort_on' )
00060         self.assertEqual( items[0][1], 'foofield' )
00061         self.assertEqual( items[1][0], 'sort_order' )
00062         self.assertEqual( items[1][1], 'reverse' )
00063 


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