Commit 189316b2 authored by Jérome Perrin's avatar Jérome Perrin

ERP5Type: add support for `publish` in live tests

XXX this support is only partial, sometimes REQUEST._module_cache_set
cause problems
parent a762a40a
......@@ -153,6 +153,16 @@ class ERP5TypeLiveTestCase(ERP5TypeTestCaseMixin):
setUp = PortalTestCase.setUp
tearDown = PortalTestCase.tearDown
def publish(self, *args, **kw):
# Zope.Testing.ZopeTestCase.functional publish, with support for request within a request
from zope.security.management import endInteraction
from zope.security.management import restoreInteraction
endInteraction()
try:
return super(ERP5TypeLiveTestCase, self).publish(*args, **kw)
finally:
restoreInteraction()
def _app(self):
'''Returns the app object for a test.'''
return self.getPortal().aq_parent
......
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