Back to index

plone3  3.1.7
Public Member Functions | Private Attributes
ATContentTypes.tests.test_atfolder.TestATBTreeFolderFields Class Reference
Inheritance diagram for ATContentTypes.tests.test_atfolder.TestATBTreeFolderFields:
Inheritance graph
[legend]
Collaboration diagram for ATContentTypes.tests.test_atfolder.TestATBTreeFolderFields:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_field_enableConstrainMixin
def test_field_locallyAllowedTypes
def createDummy
def test_description
def test_id
def test_relateditems

Private Attributes

 _dummy

Detailed Description

Definition at line 188 of file test_atfolder.py.


Member Function Documentation

Reimplemented from ATContentTypes.tests.test_atfolder.TestATFolderFields.

Definition at line 190 of file test_atfolder.py.

00190 
00191     def afterSetUp(self):
00192         atcttestcase.ATCTFieldTestCase.afterSetUp(self)
00193         self._dummy = self.createDummy(klass=ATBTreeFolder)
00194 
00195 tests.append(TestATBTreeFolderFields)

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

Definition at line 243 of file atcttestcase.py.

00243 
00244     def createDummy(self, klass, id='dummy'):
00245         portal = self.portal
00246         dummy = klass(oid=id)
00247         # put dummy in context of portal
00248         dummy = dummy.__of__(portal)
00249         portal.dummy = dummy
00250         dummy.initializeArchetype()
00251         return dummy

Here is the call graph for this function:

Definition at line 252 of file atcttestcase.py.

00252 
00253     def test_description(self):
00254         dummy = self._dummy
00255         field = dummy.getField('description')
00256 
00257         self.failUnless(ILayerContainer.isImplementedBy(field))
00258         self.failUnlessEqual(field.required, False)
00259         self.failUnlessEqual(field.default, '')
00260         self.failUnlessEqual(field.searchable, True)
00261         self.failUnlessEqual(field.primary, False)
00262         vocab = field.vocabulary
00263         self.failUnlessEqual(vocab, ())
00264         self.failUnlessEqual(field.enforceVocabulary, False)
00265         self.failUnlessEqual(field.multiValued, False)
00266         self.failUnlessEqual(field.isMetadata, True)
00267         self.failUnlessEqual(field.accessor, 'Description')
00268         self.failUnlessEqual(field.mutator, 'setDescription')
00269         self.failUnlessEqual(field.edit_accessor, 'getRawDescription')
00270         self.failUnlessEqual(field.read_permission, View)
00271         self.failUnlessEqual(field.write_permission, ModifyPortalContent)
00272         self.failUnlessEqual(field.generateMode, 'mVc')
00273         #self.failUnless(field.generateMode == 'veVc', field.generateMode)
00274         self.failUnlessEqual(field.force, '')
00275         self.failUnlessEqual(field.type, 'text')
00276         self.failUnless(isinstance(field.storage, MetadataStorage))
00277         self.failUnless(field.getLayerImpl('storage') == MetadataStorage())
00278         self.failUnlessEqual(field.validators, EmptyValidator)
00279         self.failUnless(isinstance(field.widget, TextAreaWidget))
00280         vocab = field.Vocabulary(dummy)
00281         self.failUnless(isinstance(vocab, DisplayList))
00282         self.failUnlessEqual(tuple(vocab), ())

Definition at line 178 of file test_atfolder.py.

00178 
00179     def test_field_enableConstrainMixin(self):
00180         pass
00181         #self.fail('not implemented')

Definition at line 182 of file test_atfolder.py.

00182 
00183     def test_field_locallyAllowedTypes(self):
00184         pass
00185         #self.fail('not implemented')
00186 
00187 tests.append(TestATFolderFields)

Definition at line 283 of file atcttestcase.py.

00283 
00284     def test_id(self):
00285         dummy = self._dummy
00286         field = dummy.getField('id')
00287 
00288         self.failUnless(ILayerContainer.isImplementedBy(field))
00289         self.failUnlessEqual(field.required, False)
00290         self.failUnlessEqual(field.default, None)
00291         self.failUnlessEqual(field.searchable, True)
00292         self.failUnlessEqual(getattr(field, 'primary', None), None)
00293         vocab = field.vocabulary
00294         self.failUnlessEqual(vocab, ())
00295         self.failUnlessEqual(field.enforceVocabulary, False)
00296         self.failUnlessEqual(field.multiValued, False)
00297         self.failUnlessEqual(field.isMetadata, False)
00298         self.failUnlessEqual(field.accessor, 'getId')
00299         self.failUnlessEqual(field.mutator, 'setId')
00300         self.failUnlessEqual(field.edit_accessor, 'getRawId')
00301         self.failUnlessEqual(field.read_permission, View)
00302         self.failUnlessEqual(field.write_permission, ModifyPortalContent)
00303         self.failUnlessEqual(field.generateMode, 'veVc')
00304         self.failUnlessEqual(field.force, '')
00305         self.failUnlessEqual(field.type, 'string')
00306         self.failUnless(isinstance(field.storage, AttributeStorage))
00307         self.failUnless(field.getLayerImpl('storage') == AttributeStorage())
00308         self.failUnlessEqual(field.validators, idValidator)
00309         self.failUnless(isinstance(field.widget, IdWidget))
00310         vocab = field.Vocabulary(dummy)
00311         self.failUnless(isinstance(vocab, DisplayList))
00312         self.failUnlessEqual(tuple(vocab), ())

Definition at line 313 of file atcttestcase.py.

00313 
00314     def test_relateditems(self):
00315         dummy = self._dummy
00316         field = dummy.getField('relatedItems')
00317 
00318         self.failUnless(ILayerContainer.isImplementedBy(field))
00319         self.failUnlessEqual(field.required, False)
00320         self.failUnlessEqual(field.default, None)
00321         self.failUnlessEqual(field.searchable, False)
00322         self.failUnlessEqual(getattr(field, 'primary', None), None)
00323         vocab = field.vocabulary
00324         self.failUnlessEqual(vocab, ())
00325         self.failUnlessEqual(field.enforceVocabulary, False)
00326         self.failUnlessEqual(field.multiValued, True)
00327         self.failUnlessEqual(field.isMetadata, True)
00328         self.failUnlessEqual(field.accessor, 'getRelatedItems')
00329         self.failUnlessEqual(field.mutator, 'setRelatedItems')
00330         self.failUnlessEqual(field.edit_accessor, 'getRawRelatedItems')
00331         self.failUnlessEqual(field.read_permission, View)
00332         self.failUnlessEqual(field.write_permission, ModifyPortalContent)
00333         self.failUnlessEqual(field.generateMode, 'veVc')
00334         self.failUnlessEqual(field.force, '')
00335         self.failUnlessEqual(field.type, 'reference')
00336         self.failUnless(isinstance(field.storage, AttributeStorage))
00337         self.failUnless(field.getLayerImpl('storage') == AttributeStorage())
00338         self.failUnlessEqual(field.validators, EmptyValidator)
00339         self.failUnless(isinstance(field.widget, ReferenceBrowserWidget))
00340         vocab = field.Vocabulary(dummy)
00341         self.failUnless(isinstance(vocab, DisplayList))
00342 

Member Data Documentation

Reimplemented from ATContentTypes.tests.test_atfolder.TestATFolderFields.

Definition at line 192 of file test_atfolder.py.


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