Commit d6c47282 authored by Aurel's avatar Aurel Committed by Arnaud Fontaine

wip : test not patching WSGIPublisher as it is a backport from Zope4

parent dffb5d64
...@@ -20,7 +20,7 @@ import ZConfig ...@@ -20,7 +20,7 @@ import ZConfig
import Zope2 import Zope2
from Zope2.Startup.run import make_wsgi_app from Zope2.Startup.run import make_wsgi_app
from Products.ERP5Type.patches.WSGIPublisher import publish_module from ZPublisher.WSGIPublisher import publish_module
# this class licensed under the MIT license (stolen from pyramid_translogger) # this class licensed under the MIT license (stolen from pyramid_translogger)
......
...@@ -24,7 +24,7 @@ import six ...@@ -24,7 +24,7 @@ import six
from Products.ERP5Type import WITH_LEGACY_WORKFLOW from Products.ERP5Type import WITH_LEGACY_WORKFLOW
# Load all monkey patches # Load all monkey patches
from Products.ERP5Type.patches import WSGIPublisher #from Products.ERP5Type.patches import WSGIPublisher
from Products.ERP5Type.patches import HTTPRequest from Products.ERP5Type.patches import HTTPRequest
from Products.ERP5Type.patches import AccessControl_patch from Products.ERP5Type.patches import AccessControl_patch
from Products.ERP5Type.patches import Restricted from Products.ERP5Type.patches import Restricted
......
...@@ -411,7 +411,7 @@ def load_app(module_info): ...@@ -411,7 +411,7 @@ def load_app(module_info):
try: try:
yield (app, realm, debug_mode, validated_hook) yield (app, realm, debug_mode, validated_hook)
finally: finally:
if transaction.manager._txn is not None: if getattr(transaction.manager, '_txn', None) is not None:
# Only abort a transaction, if one exists. Otherwise the # Only abort a transaction, if one exists. Otherwise the
# abort creates a new transaction just to abort it. # abort creates a new transaction just to abort it.
transaction.abort() transaction.abort()
...@@ -496,4 +496,4 @@ def publish_module(environ, start_response, ...@@ -496,4 +496,4 @@ def publish_module(environ, start_response,
return result return result
sys.modules['ZPublisher.WSGIPublisher'] = sys.modules[__name__] #sys.modules['ZPublisher.WSGIPublisher'] = sys.modules[__name__]
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