Example #1
0
 def setup(self):
     db = DB()
     conn = db.open()
     root = conn.root()
     root[ZopePublication.root_name] = self
     provideAdapter(lambda ignored: self,
                    adapts=(None, ),
                    provides=ISchoolToolApplication)
     commit()
     createSiteManager(self, setsite=True)
     initializeSchoolToolPlugins(ApplicationInitializationEvent(self))
     notify(CatalogStartUpEvent(self))
def setUpRoot(test):
    db = DB()
    conn = db.open()
    dbroot = conn.root()
    dbroot['root'] = root = siteSetUp(True)
    transaction.commit()
    test.globs['root'] = root
    
    zope.component.provideAdapter(SimpleKeyReference)

    sm = root.getSiteManager()
    intids = sm['default']['intids'] = zope.intid.IntIds()
    sm.registerUtility(intids, zope.intid.interfaces.IIntIds)