ZopeTestCase is missing ZODB connection isolation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Won't Fix
|
Wishlist
|
Unassigned |
Bug Description
Hello,
I've stumbled upon an issue with Testing.
everything up so that there only ever is one single ZODB connection
per test, that is shared among all requests, the test code,
everything.
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[1] that fixes this issue which I'm using in
gocept.selenium, passing specific tests of the problematic behaviour[2].
Wolfgang
[1] see
http://
inlining here for convenience:
Testing.
def _app(self):
Zope2.startup()
stuff = Zope2.bobo_
db = Testing.
Zope2.
app = Zope2.bobo_
app = Testing.
Testing.
return app
[2] see
http://
http://
Is there a reason you are not using plone.testing (http:// pypi.python. org/pypi/ plone.testing) to get proper ZODB isolation?
plone.testing and it's Plone integration layer plone.app.testing have been written to fix many of the shortcomings in zope.testing's layer approach and provide useful layers and helpers for testing Zope and Plone. Going forward I expect ZopeTestCase and the products based on it like PloneTestCase to go away and be replaced with the newer approach.