Commit 65a6e925 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add a workaround to make sure that get_request works.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6128 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b92e5551
...@@ -6,6 +6,17 @@ ...@@ -6,6 +6,17 @@
__version__ = '0.3.0' __version__ = '0.3.0'
# XXX make sure that get_request works.
current_app = None
import Products.ERP5Type.Utils
import Globals
def get_request():
return current_app.REQUEST
Products.ERP5Type.Utils.get_request = get_request
Globals = get_request
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Testing.ZopeTestCase.PortalTestCase import PortalTestCase, user_name from Testing.ZopeTestCase.PortalTestCase import PortalTestCase, user_name
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
...@@ -314,6 +325,8 @@ def setupERP5Site(business_template_list=(), app=None, portal_name=portal_name, ...@@ -314,6 +325,8 @@ def setupERP5Site(business_template_list=(), app=None, portal_name=portal_name,
try: try:
if app is None: if app is None:
app = ZopeTestCase.app() app = ZopeTestCase.app()
global current_app
current_app = app
if not hasattr(aq_base(app), portal_name): if not hasattr(aq_base(app), portal_name):
try: try:
_start = time.time() _start = time.time()
......
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