Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def test_locationField
def test_eventTypeField
def test_eventUrlField
def test_startDateField
def test_endDateField
def test_contactNameField
def test_contactEmailField
def test_contactPhoneField
def test_attendeesField
def test_textField
def beforeTearDown
def createDummy
def test_description
def test_id
def test_relateditems

Private Attributes

 _dummy

Detailed Description

Definition at line 182 of file test_atevent.py.


Member Function Documentation

Reimplemented from ATContentTypes.tests.atcttestcase.ATCTFieldTestCase.

Definition at line 184 of file test_atevent.py.

00184 
00185     def afterSetUp(self):
00186         atcttestcase.ATCTFieldTestCase.afterSetUp(self)
00187         self._dummy = self.createDummy(klass=ATEvent)

Definition at line 607 of file test_atevent.py.

00607 
00608     def beforeTearDown(self):
00609         # more
00610         atcttestcase.ATCTFieldTestCase.beforeTearDown(self)
00611 
00612 tests.append(TestATEventFields)

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 518 of file test_atevent.py.

00518 
00519     def test_attendeesField(self):
00520         dummy = self._dummy
00521         field = dummy.getField('attendees')
00522 
00523         self.failUnless(ILayerContainer.isImplementedBy(field))
00524         self.failUnless(field.required == 0, 'Value is %s' % field.required)
00525         self.failUnless(field.default == (), 'Value is %s' % str(field.default))
00526         self.failUnless(field.searchable == 1, 'Value is %s' % field.searchable)
00527         self.failUnless(field.vocabulary == (),
00528                         'Value is %s' % str(field.vocabulary))
00529         self.failUnless(field.enforceVocabulary == 0,
00530                         'Value is %s' % field.enforceVocabulary)
00531         self.failUnless(field.multiValued == 0,
00532                         'Value is %s' % field.multiValued)
00533         self.failUnless(field.isMetadata == 0, 'Value is %s' % field.isMetadata)
00534         self.failUnless(field.accessor == 'getAttendees',
00535                         'Value is %s' % field.accessor)
00536         self.failUnless(field.mutator == 'setAttendees',
00537                         'Value is %s' % field.mutator)
00538         self.failUnless(field.read_permission == View,
00539                         'Value is %s' % field.read_permission)
00540         self.failUnless(field.write_permission ==
00541                         ChangeEvents,
00542                         'Value is %s' % field.write_permission)
00543         self.failUnless(field.generateMode == 'veVc',
00544                         'Value is %s' % field.generateMode)
00545         self.failUnless(field.force == '', 'Value is %s' % field.force)
00546         self.failUnless(field.type == 'lines', 'Value is %s' % field.type)
00547         self.failUnless(isinstance(field.storage, AttributeStorage),
00548                         'Value is %s' % type(field.storage))
00549         self.failUnless(field.getLayerImpl('storage') == AttributeStorage(),
00550                         'Value is %s' % field.getLayerImpl('storage'))
00551         self.failUnless(ILayerContainer.isImplementedBy(field))
00552         self.failUnless(isinstance(field.widget, LinesWidget),
00553                         'Value is %s' % id(field.widget))
00554         vocab = field.Vocabulary(dummy)
00555         self.failUnless(isinstance(vocab, DisplayList),
00556                         'Value is %s' % type(vocab))
00557         self.failUnless(tuple(vocab) == (), 'Value is %s' % str(tuple(vocab)))

Definition at line 435 of file test_atevent.py.

00435 
00436     def test_contactEmailField(self):
00437         dummy = self._dummy
00438         field = dummy.getField('contactEmail')
00439 
00440         self.failUnless(ILayerContainer.isImplementedBy(field))
00441         self.failUnless(field.required == 0, 'Value is %s' % field.required)
00442         self.failUnless(field.default == '', 'Value is %s' % str(field.default))
00443         self.failUnless(field.searchable == 1, 'Value is %s' % field.searchable)
00444         self.failUnless(field.vocabulary == (),
00445                         'Value is %s' % str(field.vocabulary))
00446         self.failUnless(field.enforceVocabulary == 0,
00447                         'Value is %s' % field.enforceVocabulary)
00448         self.failUnless(field.multiValued == 0,
00449                         'Value is %s' % field.multiValued)
00450         self.failUnless(field.isMetadata == 0, 'Value is %s' % field.isMetadata)
00451         self.failUnless(field.accessor == 'contact_email',
00452                         'Value is %s' % field.accessor)
00453         self.failUnless(field.mutator == 'setContactEmail',
00454                         'Value is %s' % field.mutator)
00455         self.failUnless(field.read_permission == View,
00456                         'Value is %s' % field.read_permission)
00457         self.failUnless(field.write_permission ==
00458                         ChangeEvents,
00459                         'Value is %s' % field.write_permission)
00460         self.failUnless(field.generateMode == 'veVc',
00461                         'Value is %s' % field.generateMode)
00462         self.failUnless(field.force == '', 'Value is %s' % field.force)
00463         self.failUnless(field.type == 'string', 'Value is %s' % field.type)
00464         self.failUnless(isinstance(field.storage, AttributeStorage),
00465                         'Value is %s' % type(field.storage))
00466         self.failUnless(field.getLayerImpl('storage') == AttributeStorage(),
00467                         'Value is %s' % field.getLayerImpl('storage'))
00468         self.failUnless(ILayerContainer.isImplementedBy(field))
00469         self.failUnless(field.validators == EmailValidator,
00470                         'Value is %s' % str(field.validators))
00471         self.failUnless(isinstance(field.widget, StringWidget),
00472                         'Value is %s' % id(field.widget))
00473         vocab = field.Vocabulary(dummy)
00474         self.failUnless(isinstance(vocab, DisplayList),
00475                         'Value is %s' % type(vocab))
00476         self.failUnless(tuple(vocab) == (), 'Value is %s' % str(tuple(vocab)))

Definition at line 393 of file test_atevent.py.

00393 
00394     def test_contactNameField(self):
00395         dummy = self._dummy
00396         field = dummy.getField('contactName')
00397 
00398         self.failUnless(ILayerContainer.isImplementedBy(field))
00399         self.failUnless(field.required == 0, 'Value is %s' % field.required)
00400         self.failUnless(field.default == '', 'Value is %s' % str(field.default))
00401         self.failUnless(field.searchable == 1, 'Value is %s' % field.searchable)
00402         self.failUnless(field.vocabulary == (),
00403                         'Value is %s' % str(field.vocabulary))
00404         self.failUnless(field.enforceVocabulary == 0,
00405                         'Value is %s' % field.enforceVocabulary)
00406         self.failUnless(field.multiValued == 0,
00407                         'Value is %s' % field.multiValued)
00408         self.failUnless(field.isMetadata == 0, 'Value is %s' % field.isMetadata)
00409         self.failUnless(field.accessor == 'contact_name',
00410                         'Value is %s' % field.accessor)
00411         self.failUnless(field.mutator == 'setContactName',
00412                         'Value is %s' % field.mutator)
00413         self.failUnless(field.read_permission == View,
00414                         'Value is %s' % field.read_permission)
00415         self.failUnless(field.write_permission ==
00416                         ChangeEvents,
00417                         'Value is %s' % field.write_permission)
00418         self.failUnless(field.generateMode == 'veVc',
00419                         'Value is %s' % field.generateMode)
00420         self.failUnless(field.force == '', 'Value is %s' % field.force)
00421         self.failUnless(field.type == 'string', 'Value is %s' % field.type)
00422         self.failUnless(isinstance(field.storage, AttributeStorage),
00423                         'Value is %s' % type(field.storage))
00424         self.failUnless(field.getLayerImpl('storage') == AttributeStorage(),
00425                         'Value is %s' % field.getLayerImpl('storage'))
00426         self.failUnless(ILayerContainer.isImplementedBy(field))
00427         self.failUnless(field.validators == EmptyValidator,
00428                         'Value is %s' % str(field.validators))
00429         self.failUnless(isinstance(field.widget, StringWidget),
00430                         'Value is %s' % id(field.widget))
00431         vocab = field.Vocabulary(dummy)
00432         self.failUnless(isinstance(vocab, DisplayList),
00433                         'Value is %s' % type(vocab))
00434         self.failUnless(tuple(vocab) == (), 'Value is %s' % str(tuple(vocab)))

Definition at line 477 of file test_atevent.py.

00477 
00478     def test_contactPhoneField(self):
00479         dummy = self._dummy
00480         field = dummy.getField('contactPhone')
00481 
00482         self.failUnless(ILayerContainer.isImplementedBy(field))
00483         self.failUnless(field.required == 0, 'Value is %s' % field.required)
00484         self.failUnless(field.default == '', 'Value is %s' % str(field.default))
00485         self.failUnless(field.searchable == 1, 'Value is %s' % field.searchable)
00486         self.failUnless(field.vocabulary == (),
00487                         'Value is %s' % str(field.vocabulary))
00488         self.failUnless(field.enforceVocabulary == 0,
00489                         'Value is %s' % field.enforceVocabulary)
00490         self.failUnless(field.multiValued == 0,
00491                         'Value is %s' % field.multiValued)
00492         self.failUnless(field.isMetadata == 0, 'Value is %s' % field.isMetadata)
00493         self.failUnless(field.accessor == 'contact_phone',
00494                         'Value is %s' % field.accessor)
00495         self.failUnless(field.mutator == 'setContactPhone',
00496                         'Value is %s' % field.mutator)
00497         self.failUnless(field.read_permission == View,
00498                         'Value is %s' % field.read_permission)
00499         self.failUnless(field.write_permission ==
00500                         ChangeEvents,
00501                         'Value is %s' % field.write_permission)
00502         self.failUnless(field.generateMode == 'veVc',
00503                         'Value is %s' % field.generateMode)
00504         self.failUnless(field.force == '', 'Value is %s' % field.force)
00505         self.failUnless(field.type == 'string', 'Value is %s' % field.type)
00506         self.failUnless(isinstance(field.storage, AttributeStorage),
00507                         'Value is %s' % type(field.storage))
00508         self.failUnless(field.getLayerImpl('storage') == AttributeStorage(),
00509                         'Value is %s' % field.getLayerImpl('storage'))
00510         self.failUnless(ILayerContainer.isImplementedBy(field))
00511         self.failUnlessEqual(field.validators, EmptyValidator)
00512         self.failUnless(isinstance(field.widget, StringWidget),
00513                         'Value is %s' % id(field.widget))
00514         vocab = field.Vocabulary(dummy)
00515         self.failUnless(isinstance(vocab, DisplayList),
00516                         'Value is %s' % type(vocab))
00517         self.failUnless(tuple(vocab) == (), 'Value is %s' % str(tuple(vocab)))

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 350 of file test_atevent.py.

00350 
00351     def test_endDateField(self):
00352         dummy = self._dummy
00353         field = dummy.getField('endDate')
00354 
00355         self.failUnless(ILayerContainer.isImplementedBy(field))
00356         self.failUnless(field.required == 1, 'Value is %s' % field.required)
00357         self.failUnless(field.default == None , 'Value is %s' % str(field.default))
00358         self.failUnless(field.default_method == DateTime , 'Value is %s' % str(field.default_method))
00359         self.failUnless(field.searchable == False, 'Value is %s' % field.searchable)
00360         self.failUnless(field.vocabulary == (),
00361                         'Value is %s' % str(field.vocabulary))
00362         self.failUnless(field.enforceVocabulary == 0,
00363                         'Value is %s' % field.enforceVocabulary)
00364         self.failUnless(field.multiValued == 0,
00365                         'Value is %s' % field.multiValued)
00366         self.failUnless(field.isMetadata == 0, 'Value is %s' % field.isMetadata)
00367         self.failUnless(field.accessor == 'end',
00368                         'Value is %s' % field.accessor)
00369         self.failUnless(field.mutator == 'setEndDate',
00370                         'Value is %s' % field.mutator)
00371         self.failUnless(field.read_permission == View,
00372                         'Value is %s' % field.read_permission)
00373         self.failUnless(field.write_permission ==
00374                         ChangeEvents,
00375                         'Value is %s' % field.write_permission)
00376         self.failUnless(field.generateMode == 'veVc',
00377                         'Value is %s' % field.generateMode)
00378         self.failUnless(field.force == '', 'Value is %s' % field.force)
00379         self.failUnless(field.type == 'datetime', 'Value is %s' % field.type)
00380         self.failUnless(isinstance(field.storage, AttributeStorage),
00381                         'Value is %s' % type(field.storage))
00382         self.failUnless(field.getLayerImpl('storage') == AttributeStorage(),
00383                         'Value is %s' % field.getLayerImpl('storage'))
00384         self.failUnless(ILayerContainer.isImplementedBy(field))
00385         self.failUnless(field.validators == (),
00386                         'Value is %s' % str(field.validators))
00387         self.failUnless(isinstance(field.widget, CalendarWidget),
00388                         'Value is %s' % id(field.widget))
00389         vocab = field.Vocabulary(dummy)
00390         self.failUnless(isinstance(vocab, DisplayList),
00391                         'Value is %s' % type(vocab))
00392         self.failUnless(tuple(vocab) == (), 'Value is %s' % str(tuple(vocab)))

Definition at line 229 of file test_atevent.py.

00229 
00230     def test_eventTypeField(self):
00231         dummy = self._dummy
00232         field = dummy.getField('eventType')
00233         self.failUnless(ILayerContainer.isImplementedBy(field))
00234         self.failUnless(field.required == 0, 'Value is %s' % field.required)
00235         self.failUnless(field.default == (), 'Value is %s' % str(str(field.default)))
00236         self.failUnless(field.searchable == 1, 'Value is %s' % field.searchable)
00237         self.failUnless(field.enforceVocabulary == 0,
00238                         'Value is %s' % field.enforceVocabulary)
00239         self.failUnless(field.multiValued == 0,
00240                         'Value is %s' % field.multiValued)
00241         self.failUnless(field.isMetadata == 0, 'Value is %s' % field.isMetadata)
00242         self.failUnless(field.accessor == 'getEventType',
00243                         'Value is %s' % field.accessor)
00244         self.failUnless(field.mutator == 'setEventType',
00245                         'Value is %s' % field.mutator)
00246         self.failUnless(field.read_permission == View,
00247                         'Value is %s' % field.read_permission)
00248         self.failUnless(field.write_permission ==
00249                         ChangeEvents,
00250                         'Value is %s' % field.write_permission)
00251         self.failUnless(field.generateMode == 'veVc',
00252                         'Value is %s' % field.generateMode)
00253         self.failUnless(field.force == '', 'Value is %s' % field.force)
00254         self.failUnless(field.type == 'lines', 'Value is %s' % field.type)
00255         self.failUnless(isinstance(field.storage, AttributeStorage),
00256                         'Value is %s' % type(field.storage))
00257         self.failUnless(field.getLayerImpl('storage') == AttributeStorage(),
00258                         'Value is %s' % field.getLayerImpl('storage'))
00259         self.failUnless(ILayerContainer.isImplementedBy(field))
00260         self.failUnless(field.validators == EmptyValidator,
00261                         'Value is %s' % repr(field.validators))
00262         self.failUnless(isinstance(field.widget, KeywordWidget),
00263                         'Value is %s' % id(field.widget))
00264 

Definition at line 265 of file test_atevent.py.

00265 
00266     def test_eventUrlField(self):
00267         dummy = self._dummy
00268         field = dummy.getField('eventUrl')
00269 
00270         self.failUnless(ILayerContainer.isImplementedBy(field))
00271         self.failUnless(field.required == 0, 'Value is %s' % field.required)
00272         self.failUnless(field.default == '', 'Value is %s' % str(field.default))
00273         self.failUnless(field.searchable == 1, 'Value is %s' % field.searchable)
00274         self.failUnless(field.vocabulary == (),
00275                         'Value is %s' % str(field.vocabulary))
00276         self.failUnless(field.enforceVocabulary == 0,
00277                         'Value is %s' % field.enforceVocabulary)
00278         self.failUnless(field.multiValued == 0,
00279                         'Value is %s' % field.multiValued)
00280         self.failUnless(field.isMetadata == 0, 'Value is %s' % field.isMetadata)
00281         self.failUnless(field.accessor == 'event_url',
00282                         'Value is %s' % field.accessor)
00283         self.failUnless(field.mutator == 'setEventUrl',
00284                         'Value is %s' % field.mutator)
00285         self.failUnless(field.read_permission == View,
00286                         'Value is %s' % field.read_permission)
00287         self.failUnless(field.write_permission ==
00288                         ChangeEvents,
00289                         'Value is %s' % field.write_permission)
00290         self.failUnless(field.generateMode == 'veVc',
00291                         'Value is %s' % field.generateMode)
00292         self.failUnless(field.force == '', 'Value is %s' % field.force)
00293         self.failUnless(field.type == 'string', 'Value is %s' % field.type)
00294         self.failUnless(isinstance(field.storage, AttributeStorage),
00295                         'Value is %s' % type(field.storage))
00296         self.failUnless(field.getLayerImpl('storage') == AttributeStorage(),
00297                         'Value is %s' % field.getLayerImpl('storage'))
00298         self.failUnless(ILayerContainer.isImplementedBy(field))
00299         self.failUnlessEqual(field.validators, URLValidator)
00300         self.failUnless(isinstance(field.widget, StringWidget),
00301                         'Value is %s' % id(field.widget))
00302         vocab = field.Vocabulary(dummy)
00303         self.failUnless(isinstance(vocab, DisplayList),
00304                         'Value is %s' % type(vocab))
00305         self.failUnless(tuple(vocab) == (), 'Value is %s' % str(tuple(vocab)))

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 188 of file test_atevent.py.

00188 
00189     def test_locationField(self):
00190         dummy = self._dummy
00191         field = dummy.getField('location')
00192 
00193         self.failUnless(ILayerContainer.isImplementedBy(field))
00194         self.failUnless(field.required == 0, 'Value is %s' % field.required)
00195         self.failUnless(field.default == '', 'Value is %s' % str(field.default))
00196         self.failUnless(field.searchable == 1, 'Value is %s' % field.searchable)
00197         self.failUnless(field.vocabulary == (),
00198                         'Value is %s' % str(field.vocabulary))
00199         self.failUnless(field.enforceVocabulary == 0,
00200                         'Value is %s' % field.enforceVocabulary)
00201         self.failUnless(field.multiValued == 0,
00202                         'Value is %s' % field.multiValued)
00203         self.failUnless(field.isMetadata == 0, 'Value is %s' % field.isMetadata)
00204         self.failUnless(field.accessor == 'getLocation',
00205                         'Value is %s' % field.accessor)
00206         self.failUnless(field.mutator == 'setLocation',
00207                         'Value is %s' % field.mutator)
00208         self.failUnless(field.read_permission == View,
00209                         'Value is %s' % field.read_permission)
00210         self.failUnless(field.write_permission == ChangeEvents,
00211                         'Value is %s' % field.write_permission)
00212         self.failUnless(field.generateMode == 'veVc',
00213                         'Value is %s' % field.generateMode)
00214         self.failUnless(field.force == '', 'Value is %s' % field.force)
00215         self.failUnless(field.type == 'string', 'Value is %s' % field.type)
00216         self.failUnless(isinstance(field.storage, AttributeStorage),
00217                         'Value is %s' % type(field.storage))
00218         self.failUnless(field.getLayerImpl('storage') == AttributeStorage(),
00219                         'Value is %s' % field.getLayerImpl('storage'))
00220         self.failUnless(ILayerContainer.isImplementedBy(field))
00221         self.failUnless(field.validators == EmptyValidator,
00222                         'Value is %s' % str(field.validators))
00223         self.failUnless(isinstance(field.widget, StringWidget),
00224                         'Value is %s' % id(field.widget))
00225         vocab = field.Vocabulary(dummy)
00226         self.failUnless(isinstance(vocab, DisplayList),
00227                         'Value is %s' % type(vocab))
00228         self.failUnless(tuple(vocab) == (), 'Value is %s' % str(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 

Definition at line 306 of file test_atevent.py.

00306 
00307     def test_startDateField(self):
00308         dummy = self._dummy
00309         field = dummy.getField('startDate')
00310 
00311         self.failUnless(ILayerContainer.isImplementedBy(field))
00312         self.failUnless(field.required == 1, 'Value is %s' % field.required)
00313         self.failUnless(field.default == None , 'Value is %s' % str(field.default))
00314         self.failUnless(field.default_method == DateTime , 'Value is %s' % str(field.default_method))
00315         self.failUnless(field.searchable == False, 'Value is %s' % field.searchable)
00316         self.failUnless(field.vocabulary == (),
00317                         'Value is %s' % str(field.vocabulary))
00318         self.failUnless(field.enforceVocabulary == 0,
00319                         'Value is %s' % field.enforceVocabulary)
00320         self.failUnless(field.multiValued == 0,
00321                         'Value is %s' % field.multiValued)
00322         self.failUnless(field.isMetadata == 0, 'Value is %s' % field.isMetadata)
00323         self.failUnless(field.accessor == 'start',
00324                         'Value is %s' % field.accessor)
00325         self.failUnless(field.mutator == 'setStartDate',
00326                         'Value is %s' % field.mutator)
00327         self.failUnless(field.read_permission == View,
00328                         'Value is %s' % field.read_permission)
00329         self.failUnless(field.write_permission ==
00330                         ChangeEvents,
00331                         'Value is %s' % field.write_permission)
00332         self.failUnless(field.generateMode == 'veVc',
00333                         'Value is %s' % field.generateMode)
00334         self.failUnless(field.force == '', 'Value is %s' % field.force)
00335         self.failUnless(field.type == 'datetime', 'Value is %s' % field.type)
00336         self.failUnless(isinstance(field.storage, AttributeStorage),
00337                         'Value is %s' % type(field.storage))
00338         self.failUnless(field.getLayerImpl('storage') == AttributeStorage(),
00339                         'Value is %s' % field.getLayerImpl('storage'))
00340         self.failUnless(ILayerContainer.isImplementedBy(field))
00341         self.failUnless(field.validators == (),
00342                         'Value is %s' % str(field.validators))
00343         self.failUnless(isinstance(field.widget, CalendarWidget),
00344                         'Value is %s' % id(field.widget))
00345         vocab = field.Vocabulary(dummy)
00346         self.failUnless(isinstance(vocab, DisplayList),
00347                         'Value is %s' % type(vocab))
00348         self.failUnless(tuple(vocab) == (), 'Value is %s' % str(tuple(vocab)))
00349 

Definition at line 558 of file test_atevent.py.

00558 
00559     def test_textField(self):
00560         dummy = self._dummy
00561         field = dummy.getField('text')
00562 
00563         self.failUnless(ILayerContainer.isImplementedBy(field))
00564         self.failUnless(field.required == 0, 'Value is %s' % field.required)
00565         self.failUnless(field.default == '', 'Value is %s' % str(field.default))
00566         self.failUnless(field.searchable == 1, 'Value is %s' % field.searchable)
00567         self.failUnless(field.vocabulary == (),
00568                         'Value is %s' % str(field.vocabulary))
00569         self.failUnless(field.enforceVocabulary == 0,
00570                         'Value is %s' % field.enforceVocabulary)
00571         self.failUnless(field.multiValued == 0,
00572                         'Value is %s' % field.multiValued)
00573         self.failUnless(field.isMetadata == 0, 'Value is %s' % field.isMetadata)
00574         self.failUnless(field.accessor == 'getText',
00575                         'Value is %s' % field.accessor)
00576         self.failUnless(field.mutator == 'setText',
00577                         'Value is %s' % field.mutator)
00578         self.failUnless(field.read_permission == View,
00579                         'Value is %s' % field.read_permission)
00580         self.failUnless(field.write_permission ==
00581                         ModifyPortalContent,
00582                         'Value is %s' % field.write_permission)
00583         self.failUnless(field.generateMode == 'veVc',
00584                         'Value is %s' % field.generateMode)
00585         self.failUnless(field.force == '', 'Value is %s' % field.force)
00586         self.failUnless(field.type == 'text', 'Value is %s' % field.type)
00587         self.failUnless(isinstance(field.storage, AnnotationStorage),
00588                         'Value is %s' % type(field.storage))
00589         self.failUnless(field.getLayerImpl('storage') == AnnotationStorage(migrate=True),
00590                         'Value is %s' % field.getLayerImpl('storage'))
00591         self.failUnless(ILayerContainer.isImplementedBy(field))
00592         self.failUnless(field.validators == NotRequiredTidyHTMLValidator,
00593                         'Value is %s' % repr(field.validators))
00594         self.failUnless(isinstance(field.widget, RichWidget),
00595                         'Value is %s' % id(field.widget))
00596         vocab = field.Vocabulary(dummy)
00597         self.failUnless(isinstance(vocab, DisplayList),
00598                         'Value is %s' % type(vocab))
00599         self.failUnless(tuple(vocab) == (), 'Value is %s' % str(tuple(vocab)))
00600 
00601         self.failUnless(field.primary == 1, 'Value is %s' % field.primary)
00602         self.failUnless(field.default_content_type is None,
00603                         'Value is %s' % field.default_content_type)
00604         self.failUnless(field.default_output_type == 'text/x-html-safe',
00605                         'Value is %s' % field.default_output_type)
00606         self.failUnless('text/html' in field.getAllowedContentTypes(dummy))


Member Data Documentation

Definition at line 186 of file test_atevent.py.


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