Commit 2d7a90c1 authored by Aurel's avatar Aurel

fake get_context in test to make Localizer work when required


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12890 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3d11c7ad
...@@ -14,6 +14,7 @@ warnings.simplefilter('ignore', DeprecationWarning, append=1) ...@@ -14,6 +14,7 @@ warnings.simplefilter('ignore', DeprecationWarning, append=1)
current_app = None current_app = None
import Products.ERP5Type.Utils import Products.ERP5Type.Utils
import Globals import Globals
# store a copy of the original method # store a copy of the original method
original_get_request = Globals.get_request original_get_request = Globals.get_request
...@@ -23,6 +24,13 @@ def get_request(): ...@@ -23,6 +24,13 @@ def get_request():
Products.ERP5Type.Utils.get_request = get_request Products.ERP5Type.Utils.get_request = get_request
Globals.get_request = get_request Globals.get_request = get_request
import itools.zope
def get_context():
return current_app
itools.zope.get_context = get_context
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.ERP5Type.tests.utils import getMySQLArguments from Products.ERP5Type.tests.utils import getMySQLArguments
......
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