def test_galery_type(self): galleries = getAllGalleryTypes() factory = collective.ptg.contentleadimage.adapters.ContentLeadImageAdapter self.assertTrue(factory in getAllGalleryTypes()) adapter = getMultiAdapter( (self.get_gallery(), TestRequest()), name=named_adapter_prefix + 'contentleadimage' ) self.failUnless(isinstance(adapter, factory))
def test_gallerytypes_registered(self): gallerytypes = getAllGalleryTypes() for t in gallerytypes: adapter = getMultiAdapter((self.gallery, self.request), name=named_adapter_prefix + t.name) self.failUnless(isinstance(adapter, t))
def test_gallerytypes_registered(self): gallerytypes = getAllGalleryTypes() for t in gallerytypes: adapter = getMultiAdapter((self.gallery, self.request), name=named_adapter_prefix + t.name) self.assertTrue(isinstance(adapter, t))
def update(self): gallerytypes = getAllGalleryTypes() displaytypes = getAllDisplayTypes() for t in gallerytypes: if len(t.schema.names()) > 0: self.add_fields_to_group(t, t.name) for t in displaytypes: if len(t.schema.names()) > 0: self.add_fields_to_group(t, t.name) super(GallerySettingsForm, self).update()