Beispiel #1
0
    def testWidgetFieldAssocs(self):
        assocs = (
            ('FileInnerContentField', 'FileInnerContentWidget'),
            ('ImageInnerContentField', 'ImageInnerContentWidget'),
            ('LinkInnerContentField', 'LinkInnerContentWidget'),
            )

        product = 'Products.PloneArticle.'

        from Products.Archetypes.Registry import fieldDescriptionRegistry
        from Products.Archetypes.Registry import widgetDescriptionRegistry
        
        for field, widget in assocs:
            module = field[:-5].lower()
            field_path = product + 'field.' + module + '.' + field
            desc = fieldDescriptionRegistry.get(field_path, None)
            self.failIf(desc is None, "%s is not registered" % field_path)

            widget_path = product + 'widget.' + module + '.' + widget
            self.assert_(
                widgetDescriptionRegistry.get(widget_path, None) is not None,
                "Widget %s is not properly registered" % widget
                )
            self.assert_(widget_path in desc.allowed_widgets(),
                        "Widget %s is not listed in allowed_widget for %s"
                        % (widget_path, field_path))
 def testField_registered(self):
     self.failUnless(
         fieldDescriptionRegistry.get(
             'Products.PloneArticle.field.smartlist.SmartListField', None),
         "SmartListField is not registered by archetypes")
Beispiel #3
0
 def testField_registered(self):
     self.failUnless(
         fieldDescriptionRegistry.get(
             'Products.PloneArticle.field.smartlist.SmartListField', None),
         "SmartListField is not registered by archetypes")