Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
ATContentTypes.tests.test_criteria.TestATSimpleIntCriterion Class Reference
Inheritance diagram for ATContentTypes.tests.test_criteria.TestATSimpleIntCriterion:
Inheritance graph
[legend]
Collaboration diagram for ATContentTypes.tests.test_criteria.TestATSimpleIntCriterion:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_base_int_query
def test_int_min
def test_int_max
def test_int_between
def afterSetUp
def createDummy
def test_000testsetup
def test_multipleCreateVariants
def test_typeInfo
def test_implements
def test_Z3implements

Public Attributes

 dummy

Static Public Attributes

 klass = ATSimpleIntCriterion
string title = 'Simple Int Criterion'
string meta_type = 'ATSimpleIntCriterion'
string portal_type = 'ATSimpleIntCriterion'

Detailed Description

Definition at line 282 of file test_criteria.py.


Member Function Documentation

Reimplemented in ATContentTypes.tests.test_criteria.TestATRelativePathCriterion, and ATContentTypes.tests.test_criteria.TestATCurrentAuthorCriterion.

Definition at line 68 of file test_criteria.py.

00068 
00069     def afterSetUp(self):
00070         atcttestcase.ATCTSiteTestCase.afterSetUp(self)
00071         self.dummy = self.createDummy(self.klass)

def ATContentTypes.tests.test_criteria.CriteriaTest.createDummy (   self,
  klass,
  id = 'dummy' 
) [inherited]

Definition at line 72 of file test_criteria.py.

00072 
00073     def createDummy(self, klass, id='dummy'):
00074         folder = self.folder
00075         if klass is not None:
00076             dummy = klass(id, 'dummyfield')
00077             # put dummy in context of portal
00078             folder._setObject(id, dummy)
00079             dummy = getattr(folder, id)
00080             dummy.initializeArchetype()
00081         else:
00082             dummy = None
00083         return dummy

Here is the call graph for this function:

Definition at line 84 of file test_criteria.py.

00084 
00085     def test_000testsetup(self):
00086         if self.klass is not None:
00087             self.failUnless(self.klass)
00088             self.failUnless(self.portal_type)
00089             self.failUnless(self.title)
00090             self.failUnless(self.meta_type)
        

Definition at line 288 of file test_criteria.py.

00288 
00289     def test_base_int_query(self):
00290         self.dummy.Schema()['field'].set(self.dummy,'getObjPositionInParent')
00291         self.dummy.setDirection('')
00292         self.dummy.setValue(12)
00293         items = self.dummy.getCriteriaItems()
00294         self.assertEquals(len(items),1)
00295         query = items[0][1]
00296         field = items[0][0]
00297         self.assertEquals(field, 'getObjPositionInParent')
00298         self.assertEquals(query['query'], 12)

Definition at line 119 of file test_criteria.py.

00119 
00120     def test_implements(self):
00121         if self.dummy is not None:
00122             self.failIf(IReferenceable.isImplementedBy(self.dummy))
00123             self.failIf(IExtensibleMetadata.isImplementedBy(self.dummy))
00124             self.failIf(self.dummy.isReferenceable)
00125             self.failUnless(IBaseContent.isImplementedBy(self.dummy))
00126             self.failUnless(IATTopicCriterion.isImplementedBy(self.dummy))
00127             self.failUnless(verifyObject(IBaseContent, self.dummy))
00128             self.failUnless(verifyObject(IATTopicCriterion, self.dummy))

Definition at line 319 of file test_criteria.py.

00319 
00320     def test_int_between(self):
00321         self.dummy.Schema()['field'].set(self.dummy,'getObjPositionInParent')
00322         self.dummy.setDirection('min:max')
00323         self.dummy.setValue(12)
00324         self.dummy.setValue2(17)
00325         items = self.dummy.getCriteriaItems()
00326         self.assertEquals(len(items),1)
00327         query = items[0][1]
00328         self.assertEquals(query['query'], (12,17))
00329         self.assertEquals(query['range'], 'min:max')
00330 
00331 tests.append(TestATSimpleIntCriterion)
00332 

Definition at line 309 of file test_criteria.py.

00309 
00310     def test_int_max(self):
00311         self.dummy.Schema()['field'].set(self.dummy,'getObjPositionInParent')
00312         self.dummy.setDirection('max')
00313         self.dummy.setValue(12)
00314         items = self.dummy.getCriteriaItems()
00315         self.assertEquals(len(items),1)
00316         query = items[0][1]
00317         self.assertEquals(query['query'], 12)
00318         self.assertEquals(query['range'], 'max')

Definition at line 299 of file test_criteria.py.

00299 
00300     def test_int_min(self):
00301         self.dummy.Schema()['field'].set(self.dummy,'getObjPositionInParent')
00302         self.dummy.setDirection('min')
00303         self.dummy.setValue(12)
00304         items = self.dummy.getCriteriaItems()
00305         self.assertEquals(len(items),1)
00306         query = items[0][1]
00307         self.assertEquals(query['query'], 12)
00308         self.assertEquals(query['range'], 'min')

Definition at line 91 of file test_criteria.py.

00091 
00092     def test_multipleCreateVariants(self):
00093         klass = self.klass
00094         id = 'dummy'
00095         field = 'dummyfield'
00096         if klass is not None:
00097             dummy = klass(id, field)
00098             self.failUnless(dummy.getId(), id)
00099             self.failUnless(dummy.Field(), field)
00100 
00101             dummy = klass(id=id, field=field)
00102             self.failUnless(dummy.getId(), id)
00103             self.failUnless(dummy.Field(), field)
00104 
00105             dummy = klass(field, oid=id)
00106             self.failUnless(dummy.getId(), id)
00107             self.failUnless(dummy.Field(), field)
00108 
00109             dummy = klass(field=field, oid=id)
00110             self.failUnless(dummy.getId(), id)
00111             self.failUnless(dummy.Field(), field)

Reimplemented in ATContentTypes.tests.test_criteria.TestATBaseCriterion.

Definition at line 112 of file test_criteria.py.

00112 
00113     def test_typeInfo(self):
00114         if self.dummy is not None:
00115             ti = self.dummy.getTypeInfo()
00116             self.failUnlessEqual(ti.getId(), self.portal_type)
00117             self.failUnlessEqual(ti.Title(), self.title)
00118             self.failUnlessEqual(ti.Metatype(), self.meta_type)
        

Definition at line 129 of file test_criteria.py.

00129 
00130     def test_Z3implements(self):
00131         if self.dummy is not None:
00132             iface = Z3IATTopicCriterion
00133             self.failUnless(Z3verifyObject(iface, self.dummy))


Member Data Documentation

Definition at line 70 of file test_criteria.py.

Reimplemented from ATContentTypes.tests.test_criteria.CriteriaTest.

Definition at line 283 of file test_criteria.py.

Reimplemented from ATContentTypes.tests.test_criteria.CriteriaTest.

Definition at line 285 of file test_criteria.py.

Reimplemented from ATContentTypes.tests.test_criteria.CriteriaTest.

Definition at line 286 of file test_criteria.py.

Reimplemented from ATContentTypes.tests.test_criteria.CriteriaTest.

Definition at line 284 of file test_criteria.py.


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