[zope2-tracker] [Bug 694986] [NEW] ZopeTestCase is missing ZODB connection isolation
wosc at wosc.de
Tue Dec 28 06:35:59 EST 2010
Public bug reported:
I've stumbled upon an issue with Testing.ZopeTestCase.sandbox: it sets
everything up so that there only ever is one single ZODB connection
per test, that is shared among all requests, the test code,
While that's more or less fine for the usual functional tests (using
testbrowser or whatnot), it doesn't work well when you want to go
through HTTP (with Selenium, for example) -- especially not when you
want more than one thread to handle HTTP requests.
I have implemented a patch that fixes this issue which I'm using in
gocept.selenium, passing specific tests of the problematic behaviour.
inlining here for convenience:
stuff = Zope2.bobo_application._stuff
db = Testing.ZopeTestCase.ZopeLite.sandbox()
Zope2.bobo_application._stuff = (db,) + stuff[1:]
app = Zope2.bobo_application()
app = Testing.ZopeTestCase.utils.makerequest(app)
** Affects: zope2
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.
ZopeTestCase is missing ZODB connection isolation
More information about the zope2-tracker