Back to index

plone3  3.1.7
Public Member Functions | Private Attributes
Archetypes.tests.test_baseschema.BaseSchemaTest Class Reference
Inheritance diagram for Archetypes.tests.test_baseschema.BaseSchemaTest:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.tests.test_baseschema.BaseSchemaTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_id
def test_title
def test_allowdiscussion
 Metadata Properties.
def test_subject
def test_description
def test_contributors
def test_effectivedate
def test_expirationdate
def test_language
def test_rights
def test_EffectiveDate
def test_ExpiresDate
def test_Date
def test_contentEffective
def test_contentExpired

Private Attributes

 _dummy

Detailed Description

Definition at line 47 of file test_baseschema.py.


Member Function Documentation

Definition at line 49 of file test_baseschema.py.

00049 
00050     def afterSetUp(self):
00051         ATSiteTestCase.afterSetUp(self)
00052         registerType(Dummy, 'Archetypes')
00053         content_types, constructors, ftis = process_types(listTypes(), PKG_NAME)
00054         portal = self.portal
00055         dummy = Dummy(oid='dummy')
00056         # put dummy in context of portal
00057         dummy = dummy.__of__(portal)
00058         portal.dummy = dummy
00059 
00060         dummy.initializeArchetype()
00061         self._dummy = dummy
00062 

Here is the call graph for this function:

Metadata Properties.

Definition at line 122 of file test_baseschema.py.

00122 
00123     def test_allowdiscussion(self):
00124         dummy = self._dummy
00125         field = dummy.getField('allowDiscussion')
00126 
00127         self.failUnless(ILayerContainer.isImplementedBy(field))
00128         self.failUnless(field.required == 0)
00129         self.failUnless(field.default == None)
00130         self.failUnless(field.searchable == 0)
00131         self.failUnless(field.multiValued == 0)
00132         self.failUnless(field.isMetadata == 1)
00133         self.failUnless(field.accessor == 'isDiscussable')
00134         self.failUnless(field.mutator == 'allowDiscussion')
00135         self.failUnless(field.edit_accessor == 'editIsDiscussable')
00136         self.failUnless(field.read_permission == permissions.View)
00137         self.failUnless(field.write_permission ==
00138                         permissions.ModifyPortalContent)
00139         self.failUnless(field.generateMode == 'mVc')
00140         self.failUnless(field.force == '')
00141         self.failUnless(field.type == 'boolean')
00142         self.failUnless(isinstance(field.storage, MetadataStorage))
00143         self.failUnless(field.getLayerImpl('storage') == MetadataStorage())
00144         self.failUnless(field.validators == EmptyValidator)
00145         self.failUnless(isinstance(field.widget, BooleanWidget))

Definition at line 371 of file test_baseschema.py.

00371 
00372     def test_contentEffective(self):
00373         dummy = self._dummy
00374         now = DateTime()
00375         then = DateTime() + 1000
00376         self.failUnless(dummy.contentEffective(now))
00377         dummy.setExpirationDate(then)
00378         self.failUnless(dummy.contentEffective(now))
00379         dummy.setEffectiveDate(now)
00380         self.failUnless(dummy.contentEffective(now))
00381         dummy.setEffectiveDate(then)
00382         self.failIf(dummy.contentEffective(now))

Definition at line 383 of file test_baseschema.py.

00383 
00384     def test_contentExpired(self):
00385         dummy = self._dummy
00386         now = DateTime()
00387         then = DateTime() + 1000
00388         self.failIf(dummy.contentExpired())
00389         dummy.setExpirationDate(then)
00390         self.failIf(dummy.contentExpired())
00391         dummy.setExpirationDate(now)
00392         self.failUnless(dummy.contentExpired())
00393 

Definition at line 204 of file test_baseschema.py.

00204 
00205     def test_contributors(self):
00206         dummy = self._dummy
00207         field = dummy.getField('contributors')
00208 
00209         self.failUnless(ILayerContainer.isImplementedBy(field))
00210         self.failUnless(field.required == 0)
00211         self.failUnless(field.default == ())
00212         self.failUnless(field.searchable == 0)
00213         vocab = field.vocabulary
00214         self.failUnless(vocab == ())
00215         self.failUnless(field.enforceVocabulary == 0)
00216         self.failUnless(field.multiValued == 0)
00217         self.failUnless(field.isMetadata == 1)
00218         self.failUnless(field.accessor == 'Contributors')
00219         self.failUnless(field.mutator == 'setContributors')
00220         self.failUnless(field.read_permission == permissions.View)
00221         self.failUnless(field.write_permission ==
00222                         permissions.ModifyPortalContent)
00223         self.failUnless(field.generateMode == 'mVc')
00224         self.failUnless(field.force == '')
00225         self.failUnless(field.type == 'lines')
00226         self.failUnless(isinstance(field.storage, MetadataStorage))
00227         self.failUnless(field.getLayerImpl('storage') == MetadataStorage())
00228         self.failUnless(field.validators == EmptyValidator)
00229         self.failUnless(isinstance(field.widget, LinesWidget))
00230         vocab = field.Vocabulary(dummy)
00231         self.failUnless(isinstance(vocab, DisplayList))
00232         self.failUnless(tuple(vocab) == ())

Definition at line 365 of file test_baseschema.py.

00365 
00366     def test_Date(self):
00367         dummy = self._dummy
00368         self.failUnless(isinstance(dummy.Date(), str))
00369         dummy.setEffectiveDate(DateTime())
00370         self.failUnless(isinstance(dummy.Date(), str))

Definition at line 175 of file test_baseschema.py.

00175 
00176     def test_description(self):
00177         dummy = self._dummy
00178         field = dummy.getField('description')
00179 
00180         self.failUnless(ILayerContainer.isImplementedBy(field))
00181         self.failUnless(field.required == 0)
00182         self.failUnless(field.default == '')
00183         self.failUnless(field.searchable == 1)
00184         vocab = field.vocabulary
00185         self.failUnless(vocab == ())
00186         self.failUnless(field.enforceVocabulary == 0)
00187         self.failUnless(field.multiValued == 0)
00188         self.failUnless(field.isMetadata == 1)
00189         self.failUnless(field.accessor == 'Description')
00190         self.failUnless(field.mutator == 'setDescription')
00191         self.failUnless(field.read_permission == permissions.View)
00192         self.failUnless(field.write_permission ==
00193                         permissions.ModifyPortalContent)
00194         self.failUnless(field.generateMode == 'mVc')
00195         self.failUnless(field.force == '')
00196         self.failUnless(field.type == 'text')
00197         self.failUnless(isinstance(field.storage, MetadataStorage))
00198         self.failUnless(field.getLayerImpl('storage') == MetadataStorage())
00199         self.failUnless(field.validators == EmptyValidator)
00200         self.failUnless(isinstance(field.widget, TextAreaWidget))
00201         vocab = field.Vocabulary(dummy)
00202         self.failUnless(isinstance(vocab, DisplayList))
00203         self.failUnless(tuple(vocab) == ())

Definition at line 233 of file test_baseschema.py.

00233 
00234     def test_effectivedate(self):
00235         dummy = self._dummy
00236         field = dummy.getField('effectiveDate')
00237 
00238         self.failUnless(ILayerContainer.isImplementedBy(field))
00239         self.failUnless(field.required == 0)
00240         self.failUnlessEqual(field.default, None)
00241         self.failUnlessEqual(dummy.effective(), FLOOR_DATE)
00242         self.failUnless(field.searchable == 0)
00243         vocab = field.vocabulary
00244         self.failUnless(vocab == ())
00245         self.failUnless(field.enforceVocabulary == 0)
00246         self.failUnless(field.multiValued == 0)
00247         self.failUnless(field.isMetadata == 1)
00248         self.failUnless(field.mutator == 'setEffectiveDate')
00249         self.failUnless(field.read_permission == permissions.View)
00250         self.failUnless(field.write_permission ==
00251                         permissions.ModifyPortalContent)
00252         self.failUnless(field.generateMode == 'mVc')
00253         self.failUnless(field.force == '')
00254         self.failUnless(field.type == 'datetime')
00255         self.failUnless(isinstance(field.storage, MetadataStorage))
00256         self.failUnless(field.getLayerImpl('storage') == MetadataStorage())
00257         self.failUnless(field.validators == EmptyValidator)
00258         self.failUnless(isinstance(field.widget, CalendarWidget))
00259         vocab = field.Vocabulary(dummy)
00260         self.failUnless(isinstance(vocab, DisplayList))
00261         self.failUnless(tuple(vocab) == ())

Definition at line 351 of file test_baseschema.py.

00351 
00352     def test_EffectiveDate(self):
00353         dummy = self._dummy
00354         self.failUnless(dummy.EffectiveDate() == 'None')
00355         now = DateTime()
00356         dummy.setEffectiveDate(now)
00357         self.failUnless(dummy.EffectiveDate() == now.ISO())

Definition at line 262 of file test_baseschema.py.

00262 
00263     def test_expirationdate(self):
00264         dummy = self._dummy
00265         field = dummy.getField('expirationDate')
00266 
00267         self.failUnless(ILayerContainer.isImplementedBy(field))
00268         self.failUnless(field.required == 0)
00269         self.failUnlessEqual(field.default, None)
00270         self.failUnlessEqual(dummy.expires(), CEILING_DATE)
00271         self.failUnless(field.searchable == 0)
00272         vocab = field.vocabulary
00273         self.failUnless(vocab == ())
00274         self.failUnless(field.enforceVocabulary == 0)
00275         self.failUnless(field.multiValued == 0)
00276         self.failUnless(field.isMetadata == 1)
00277         self.failUnless(field.mutator == 'setExpirationDate')
00278         self.failUnless(field.read_permission == permissions.View)
00279         self.failUnless(field.write_permission ==
00280                         permissions.ModifyPortalContent)
00281         self.failUnless(field.generateMode == 'mVc')
00282         self.failUnless(field.force == '')
00283         self.failUnless(field.type == 'datetime')
00284         self.failUnless(isinstance(field.storage, MetadataStorage))
00285         self.failUnless(field.getLayerImpl('storage') == MetadataStorage())
00286         self.failUnless(field.validators == EmptyValidator)
00287         self.failUnless(isinstance(field.widget, CalendarWidget))
00288         vocab = field.Vocabulary(dummy)
00289         self.failUnless(isinstance(vocab, DisplayList))
00290         self.failUnless(tuple(vocab) == ())

Definition at line 358 of file test_baseschema.py.

00358 
00359     def test_ExpiresDate(self):
00360         dummy = self._dummy
00361         self.failUnless(dummy.ExpirationDate() == 'None')
00362         now = DateTime()
00363         dummy.setExpirationDate(now)
00364         self.failUnless(dummy.ExpirationDate() == now.ISO())

Definition at line 63 of file test_baseschema.py.

00063 
00064     def test_id(self):
00065         dummy = self._dummy
00066         field = dummy.getField('id')
00067 
00068         self.failUnless(ILayerContainer.isImplementedBy(field))
00069         self.failUnless(field.required == 0)
00070         self.failUnless(field.default == None)
00071         self.failUnless(field.searchable == 0)
00072         self.failUnless(field.vocabulary == ())
00073         self.failUnless(field.enforceVocabulary == 0)
00074         self.failUnless(field.multiValued == 0)
00075         self.failUnless(field.isMetadata == 0)
00076         self.failUnless(field.accessor == 'getId')
00077         self.failUnless(field.mutator == 'setId')
00078         self.failUnless(field.read_permission == permissions.View)
00079         self.failUnless(field.write_permission ==
00080                         permissions.ModifyPortalContent)
00081         self.failUnless(field.generateMode == 'veVc')
00082         self.failUnless(field.force == '')
00083         self.failUnless(field.type == 'string')
00084         self.failUnless(isinstance(field.storage, AttributeStorage))
00085         self.failUnless(field.getLayerImpl('storage') == AttributeStorage())
00086         self.failUnless(ILayerContainer.isImplementedBy(field))
00087         self.failUnless(field.validators == EmptyValidator)
00088         self.failUnless(isinstance(field.widget, IdWidget))
00089         vocab = field.Vocabulary(dummy)
00090         self.failUnless(isinstance(vocab, DisplayList))
00091         self.failUnless(tuple(vocab) == ())

Definition at line 291 of file test_baseschema.py.

00291 
00292     def test_language(self):
00293         default=LANGUAGE_DEFAULT
00294         dummy = self._dummy
00295         field = dummy.getField('language')
00296 
00297         self.failUnless(ILayerContainer.isImplementedBy(field))
00298         self.failUnless(field.required == 0)
00299         self.failUnless(field.default == LANGUAGE_DEFAULT)
00300         self.failUnless(field.searchable == 0)
00301         vocab = field.vocabulary
00302         self.failUnless(vocab == 'languages')
00303         self.failUnless(field.enforceVocabulary == 0)
00304         self.failUnless(field.multiValued == 0)
00305         self.failUnless(field.isMetadata == 1)
00306         self.failUnless(field.accessor == 'Language')
00307         self.failUnless(field.mutator == 'setLanguage')
00308         self.failUnless(field.read_permission == permissions.View)
00309         self.failUnless(field.write_permission ==
00310                         permissions.ModifyPortalContent)
00311         self.failUnless(field.generateMode == 'mVc')
00312         self.failUnless(field.force == '')
00313         self.failUnless(field.type == 'string')
00314         self.failUnless(isinstance(field.storage, MetadataStorage))
00315         self.failUnless(field.getLayerImpl('storage') == MetadataStorage())
00316         self.failUnless(field.validators == EmptyValidator)
00317         self.failUnless(isinstance(field.widget, LanguageWidget))
00318         vocab = field.Vocabulary(dummy)
00319         self.failUnless(isinstance(vocab, DisplayList))
00320         self.failUnless(vocab == dummy.languages())

Definition at line 321 of file test_baseschema.py.

00321 
00322     def test_rights(self):
00323         dummy = self._dummy
00324         field = dummy.getField('rights')
00325 
00326         self.failUnless(ILayerContainer.isImplementedBy(field))
00327         self.failUnless(field.required == 0)
00328         self.failUnless(field.default == '')
00329         self.failUnless(field.searchable == 0)
00330         vocab = field.vocabulary
00331         self.failUnless(vocab == ())
00332         self.failUnless(field.enforceVocabulary == 0)
00333         self.failUnless(field.multiValued == 0)
00334         self.failUnless(field.isMetadata == 1)
00335         self.failUnless(field.accessor == 'Rights')
00336         self.failUnless(field.mutator == 'setRights')
00337         self.failUnless(field.read_permission == permissions.View)
00338         self.failUnless(field.write_permission ==
00339                         permissions.ModifyPortalContent)
00340         self.failUnless(field.generateMode == 'mVc')
00341         self.failUnless(field.force == '')
00342         self.failUnless(field.type == 'text')
00343         self.failUnless(isinstance(field.storage, MetadataStorage))
00344         self.failUnless(field.getLayerImpl('storage') == MetadataStorage())
00345         self.failUnless(field.validators == EmptyValidator)
00346         self.failUnless(isinstance(field.widget, TextAreaWidget))
00347         vocab = field.Vocabulary(dummy)
00348         self.failUnless(isinstance(vocab, DisplayList))
00349         self.failUnless(tuple(vocab) == ())

Definition at line 146 of file test_baseschema.py.

00146 
00147     def test_subject(self):
00148         dummy = self._dummy
00149         field = dummy.getField('subject')
00150 
00151         self.failUnless(ILayerContainer.isImplementedBy(field))
00152         self.failUnless(field.required == 0)
00153         self.failUnless(field.default == ())
00154         self.failUnless(field.searchable == 1)
00155         vocab = field.vocabulary
00156         self.failUnless(vocab == ())
00157         self.failUnless(field.enforceVocabulary == 0)
00158         self.failUnless(field.multiValued == 1)
00159         self.failUnless(field.isMetadata == 1)
00160         self.failUnless(field.accessor == 'Subject')
00161         self.failUnless(field.mutator == 'setSubject')
00162         self.failUnless(field.read_permission == permissions.View)
00163         self.failUnless(field.write_permission ==
00164                         permissions.ModifyPortalContent)
00165         self.failUnless(field.generateMode == 'mVc')
00166         self.failUnless(field.force == '')
00167         self.failUnless(field.type == 'lines')
00168         self.failUnless(isinstance(field.storage, MetadataStorage))
00169         self.failUnless(field.getLayerImpl('storage') == MetadataStorage())
00170         self.failUnless(field.validators == EmptyValidator)
00171         self.failUnless(isinstance(field.widget, KeywordWidget))
00172         vocab = field.Vocabulary(dummy)
00173         self.failUnless(isinstance(vocab, DisplayList))
00174         self.failUnless(tuple(vocab) == ())

Definition at line 92 of file test_baseschema.py.

00092 
00093     def test_title(self):
00094         dummy = self._dummy
00095         field = dummy.getField('title')
00096 
00097         self.failUnless(ILayerContainer.isImplementedBy(field))
00098         self.failUnless(field.required == 1)
00099         self.failUnless(field.default == '')
00100         self.failUnless(field.searchable == 1)
00101         self.failUnless(field.vocabulary == ())
00102         self.failUnless(field.enforceVocabulary == 0)
00103         self.failUnless(field.multiValued == 0)
00104         self.failUnless(field.isMetadata == 0)
00105         self.failUnless(field.accessor == 'Title')
00106         self.failUnless(field.mutator == 'setTitle')
00107         self.failUnless(field.read_permission == permissions.View)
00108         self.failUnless(field.write_permission ==
00109                         permissions.ModifyPortalContent)
00110         self.failUnless(field.generateMode == 'veVc')
00111         self.failUnless(field.force == '')
00112         self.failUnless(field.type == 'string')
00113         self.failUnless(isinstance(field.storage, AttributeStorage))
00114         self.failUnless(field.getLayerImpl('storage') == AttributeStorage())
00115         self.failUnless(field.validators == ())
00116         self.failUnless(isinstance(field.widget, StringWidget))
00117         vocab = field.Vocabulary(dummy)
00118         self.failUnless(isinstance(vocab, DisplayList))
00119         self.failUnless(tuple(vocab) == ())


Member Data Documentation

Definition at line 60 of file test_baseschema.py.


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