def test_install_products(self): self.makeFakeProducts() self.configure(cfg) app = getApp() from OFS.Application import install_products install_products(app) obids = app.Control_Panel.Products.keys() self.assertEquals(obids, [])
def test_install_products(self): self.makeFakeProducts() self.configure(cfg) app = getApp() from OFS.Application import install_products install_products(app) obids = app.Control_Panel.Products.objectIds() for name in FAKEPRODUCTS: assert name in obids
def test_install_products_enabled(self): self.makeFakeProducts() cfg2 = cfg + '\nenable-product-installation on' self.configure(cfg2) app = getApp() from OFS.Application import install_products install_products(app) obids = app.Control_Panel.Products.keys() for name in FAKEPRODUCTS: self.assert_(name in obids)
def test_example(self): from zope.configuration.xmlconfig import xmlconfig from StringIO import StringIO xmlconfig(StringIO(self.example)) from OFS.Application import install_products from archetypes.configure import tests as module install_products(module) from Products import meta_types for fti in meta_types: if fti['name'] == 'archetypes.configure.tests: Dummy': break else: self.fail("Registration failed.") self.assertEqual(fti['product'], 'archetypes.configure.tests') self.assertEqual(fti['permission'], u'Add dummy')