def test_notify(self):
     for setup in (lambda: None), self.createRootFolder, self.createRFAndSM:
         setup()
     bootStrapSubscriber(EventStub(self.db))
     cx = self.db.open()
     root = cx.root()
     root_folder = root.get(ZopePublication.root_name, None)
     self.assertTrue(IRootFolder.providedBy(root_folder))
     package_name = '/++etc++site/default'
     traverse(root_folder, package_name)
     cx.close()
 def createTestData(cls):
     storage = FileStorage(cls.data_fs)
     db = DB(storage)
     # Create root folder and all that jazz
     bootStrapSubscriber(DatabaseOpened(db))
     connection = db.open()
     root = connection.root()
     root_folder = root[ZopePublication.root_name]
     # This is not a great way to set up test fixtures, but it'll do
     # for now
     cls.createTestDataForBrowsing(root_folder)
     cls.createTestDataForRollbacking(root_folder)
     cls.createTestDataForRollbackCanBeCancelled(root_folder)
     cls.createTestDataForImplementsOnly(root_folder)
     connection.close()
     db.close()
Exemple #3
0
    def test_bootstrapSusbcriber(self):
        bootStrapSubscriber(EventStub(self.db))

        sessionBootstrapSubscriber(EventStub(self.db))

        from zope.app.publication.zopepublication import ZopePublication
        from zope.app.component.hooks import setSite
        from zope.app import zapi

        cx = self.db.open()
        root = cx.root()
        root_folder = root[ZopePublication.root_name]
        setSite(root_folder)

        zapi.getUtility(IClientIdManager)
        zapi.getUtility(ISessionDataContainer)


        cx.close()
 def createTestData(cls):
     storage = FileStorage(cls.data_fs)
     db = DB(storage)
     # Create root folder and all that jazz
     bootStrapSubscriber(DatabaseOpened(db))
     connection = db.open()
     root = connection.root()
     root_folder = root[ZopePublication.root_name]
     transaction.get().note(u"setUp creating root folder")
     transaction.commit()
     # This is not a great way to set up test fixtures, but it'll do
     # for now
     cls.createTestDataForBrowsing(root_folder)
     cls.createTestDataForRollbacking(root_folder)
     cls.createTestDataForRollbackCanBeCancelled(root_folder)
     cls.createTestDataForImplementsOnly(root_folder)
     cls.createTestDataForTruncation(root_folder)
     connection.close()
     db.close()