Commit 63733985 authored by Shane Hathaway's avatar Shane Hathaway

The ZCatalog tests now work without importing the Zope package. Yehaw!

parent 31ca5eb2
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
import os,sys, unittest import os,sys, unittest
import Zope import ZODB, OFS.Application
from ZODB.DemoStorage import DemoStorage
from ZODB.DB import DB
from Products.ZCatalog import ZCatalog,Vocabulary from Products.ZCatalog import ZCatalog,Vocabulary
from Products.ZCatalog.Catalog import Catalog,CatalogError from Products.ZCatalog.Catalog import Catalog,CatalogError
import ExtensionClass import ExtensionClass
...@@ -18,6 +20,27 @@ from Products.PluginIndexes.KeywordIndex.KeywordIndex import KeywordIndex ...@@ -18,6 +20,27 @@ from Products.PluginIndexes.KeywordIndex.KeywordIndex import KeywordIndex
import whrandom,string, unittest import whrandom,string, unittest
def createDatabase():
# XXX We have to import and init products in order for PluginIndexes to
# be registered.
OFS.Application.import_products()
# Create a DemoStorage and put an Application in it
db = DB(DemoStorage())
conn = db.open()
root = conn.root()
app = OFS.Application.Application()
root['Application'] = app
get_transaction().commit()
# Init products
OFS.Application.initialize(app)
return app
app = createDatabase()
################################################################################ ################################################################################
# Stuff of Chris # Stuff of Chris
################################################################################ ################################################################################
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment