Back to index

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

List of all members.

Public Member Functions

def test_Empty
def test_EditWithString
def test_EditWithInt
def test_RangeMin
def test_RangeMin_withInt
def test_RangeMax
def test_RangeMax_withInt
def test_RangeMinMax
def test_RangeMinMax_withTuple

Private Member Functions

def _getTargetClass

Detailed Description

Definition at line 24 of file test_SIC.py.


Member Function Documentation

Definition at line 26 of file test_SIC.py.

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

Definition at line 51 of file test_SIC.py.

00051 
00052     def test_EditWithInt( self ):
00053         sic = self._makeOne('foo', 'foofield')
00054         sic.edit( 32 )
00055         self.assertEqual( sic.value, 32 )
00056         self.assertEqual( sic.getValueString(), '32' )
00057 
00058         items = sic.getCriteriaItems()
00059         self.assertEqual( len(items), 1 )
00060         self.assertEqual( len(items[0]), 2 )
00061         self.assertEqual( items[0][1], 32 )

Definition at line 39 of file test_SIC.py.

00039 
00040     def test_EditWithString( self ):
00041         sic = self._makeOne('foo', 'foofield')
00042         sic.edit('0')
00043         self.assertEqual( sic.value, 0 )
00044         self.assertEqual( sic.getValueString(), '0' )
00045 
00046         items = sic.getCriteriaItems()
00047         self.assertEqual( len( items ), 1 )
00048         self.assertEqual( len( items[0] ), 2 )
00049         self.assertEqual( items[0][0], 'foofield' )
00050         self.assertEqual( items[0][1], 0 )

Definition at line 31 of file test_SIC.py.

00031 
00032     def test_Empty( self ):
00033         sic = self._makeOne('foo', 'foofield')
00034         self.assertEqual( sic.getId(), 'foo' )
00035         self.assertEqual( sic.field, 'foofield' )
00036         self.assertEqual( sic.value, None )
00037         self.assertEqual( sic.getValueString(), '' )
00038         self.assertEqual( len(sic.getCriteriaItems() ), 0 )

Definition at line 90 of file test_SIC.py.

00090 
00091     def test_RangeMax( self ):
00092         sic = self._makeOne('foo', 'foofield')
00093         sic.edit( '32', self._getTargetClass().MAXIMUM )
00094 
00095         self.assertEqual( sic.value, 32 )
00096         self.assertEqual( sic.getValueString(), '32' )
00097 
00098         items = sic.getCriteriaItems()
00099         self.assertEqual( len(items), 1 )
00100         self.assertEqual( len( items[0] ), 2 )
00101         self.assertEqual( items[0][0], 'foofield' )
00102         self.assertEqual( items[0][1]['query'], 32 )
00103         self.assertEqual( items[0][1]['range'], 'max' )

Definition at line 104 of file test_SIC.py.

00104 
00105     def test_RangeMax_withInt( self ):
00106         sic = self._makeOne('foo', 'foofield')
00107         sic.edit( 32, self._getTargetClass().MAXIMUM )
00108 
00109         self.assertEqual( sic.value, 32 )
00110         self.assertEqual( sic.getValueString(), '32' )
00111 
00112         items = sic.getCriteriaItems()
00113         self.assertEqual( len(items), 1 )
00114         self.assertEqual( len( items[0] ), 2 )
00115         self.assertEqual( items[0][0], 'foofield' )
00116         self.assertEqual( items[0][1]['query'], 32 )
00117         self.assertEqual( items[0][1]['range'], 'max' )

Definition at line 62 of file test_SIC.py.

00062 
00063     def test_RangeMin( self ):
00064         sic = self._makeOne('foo', 'foofield')
00065         sic.edit( '32', self._getTargetClass().MINIMUM )
00066 
00067         self.assertEqual( sic.value, 32 )
00068         self.assertEqual( sic.getValueString(), '32' )
00069 
00070         items = sic.getCriteriaItems()
00071         self.assertEqual( len(items), 1 )
00072         self.assertEqual( len( items[0] ), 2 )
00073         self.assertEqual( items[0][0], 'foofield' )
00074         self.assertEqual( items[0][1]['query'], 32 )
00075         self.assertEqual( items[0][1]['range'], 'min' )

Definition at line 76 of file test_SIC.py.

00076 
00077     def test_RangeMin_withInt( self ):
00078         sic = self._makeOne('foo', 'foofield')
00079         sic.edit( 32, self._getTargetClass().MINIMUM )
00080 
00081         self.assertEqual( sic.value, 32 )
00082         self.assertEqual( sic.getValueString(), '32' )
00083 
00084         items = sic.getCriteriaItems()
00085         self.assertEqual( len(items), 1 )
00086         self.assertEqual( len( items[0] ), 2 )
00087         self.assertEqual( items[0][0], 'foofield' )
00088         self.assertEqual( items[0][1]['query'], 32 )
00089         self.assertEqual( items[0][1]['range'], 'min' )

Definition at line 118 of file test_SIC.py.

00118 
00119     def test_RangeMinMax( self ):
00120         sic = self._makeOne('foo', 'foofield')
00121         sic.edit( '32 34', self._getTargetClass().MINMAX )
00122 
00123         self.assertEqual( sic.value, ( 32, 34 ) )
00124         self.assertEqual( sic.getValueString(), '32 34' )
00125 
00126         items = sic.getCriteriaItems()
00127         self.assertEqual( len(items), 1 )
00128         self.assertEqual( len( items[0] ), 2 )
00129         self.assertEqual( items[0][0], 'foofield' )
00130         self.assertEqual( items[0][1]['query'], ( 32, 34 ) )
00131         self.assertEqual( items[0][1]['range'], 'min:max' )

Definition at line 132 of file test_SIC.py.

00132 
00133     def test_RangeMinMax_withTuple( self ):
00134         sic = self._makeOne('foo', 'foofield')
00135         sic.edit( ( 32, 34 ), self._getTargetClass().MINMAX )
00136 
00137         self.assertEqual( sic.value, ( 32, 34 ) )
00138         self.assertEqual( sic.getValueString(), '32 34' )
00139 
00140         items = sic.getCriteriaItems()
00141         self.assertEqual( len(items), 1 )
00142         self.assertEqual( len( items[0] ), 2 )
00143         self.assertEqual( items[0][0], 'foofield' )
00144         self.assertEqual( items[0][1]['query'], ( 32, 34 ) )
00145         self.assertEqual( items[0][1]['range'], 'min:max' )
00146 


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