Commit b1f0660c authored by Jérome Perrin's avatar Jérome Perrin

reuse DummyLocalizer from utils


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17866 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 929034f1
...@@ -53,6 +53,7 @@ import time ...@@ -53,6 +53,7 @@ import time
from Testing import ZopeTestCase from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import FileUpload from Products.ERP5Type.tests.utils import FileUpload
from Products.ERP5Type.tests.utils import DummyLocalizer
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from zLOG import LOG from zLOG import LOG
import os import os
...@@ -87,36 +88,6 @@ def makeFilePath(name): ...@@ -87,36 +88,6 @@ def makeFilePath(name):
def makeFileUpload(name): def makeFileUpload(name):
return FileUpload(makeFilePath(name), name) return FileUpload(makeFilePath(name), name)
class DummyMessageCatalog:
__allow_access_to_unprotected_subobjects__ = 1
def gettext(self, word, *args, **kw):
return word
class DummyLocalizer:
"""
A replacement for stock cookie - based localizer
"""
__allow_access_to_unprotected_subobjects__ = 1
erp5_ui = DummyMessageCatalog()
erp5_catalog = DummyMessageCatalog()
lang = 'en'
def get_selected_language(self):
return self.lang
def get_languages_map(self):
return [{'selected': True, 'id': 'en', 'title': 'English'},
{'selected': False, 'id': 'pl', 'title': 'Polish'},
{'selected': False, 'id': 'fr', 'title': 'French'},]
def changeLanguage(self, lang):
self.lang = lang
def translate(self, word, *args, **kw):
return word
def __call__(self, request, context):
pass
class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional): class TestDocument(ERP5TypeTestCase, ZopeTestCase.Functional):
""" """
......
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