Commit 90ef8add authored by Jérome Perrin's avatar Jérome Perrin

Merge branch 'george_activity_tool_fixup' of...

Merge branch 'george_activity_tool_fixup' of https://lab.nexedi.com/georgios.dagkakis/erp5 into zope4py3-merge1
parents e4bd676a ebc377f4
Pipeline #34946 failed with stage
in 0 seconds
......@@ -1402,6 +1402,19 @@ class TestBase(ERP5TypeTestCase, ZopeTestCase.Functional):
newSecurityManager(None, test_user)
assertActorHistoryEqual([user_1_title, user_2_title, user_3_user_id, existing_non_erp5_user_id])
def test_idWithSpecialCharacter(self, quiet=quiet, run=run_all_test):
"""
Test that an id with non-ascii characters
can well be used an indexed
"""
portal = self.getPortal()
portal_type = "Organisation"
module = portal.getDefaultModule(portal_type=portal_type)
obj = module.newContent(
id='tést',
portal_type=portal_type
)
self.tic()
class TestERP5PropertyManager(unittest.TestCase):
"""Tests for ERP5PropertyManager.
......
from __future__ import absolute_import
from Products.ERP5Type.Utils import str2unicode
##############################################################################
#
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
......@@ -359,7 +361,10 @@ class Message(BaseMessage):
# that method !
method = getattr(obj, self.method_id)
transaction.get().note(
u'CMFActivity {}/{}'.format('/'.join(self.object_path), self.method_id)
u'CMFActivity {}/{}'.format(
'/'.join([str2unicode(x) for x in self.object_path]),
str2unicode(self.method_id),
)
)
# Store site info
setSite(activity_tool.getParentValue())
......
......@@ -174,12 +174,12 @@ else: # For easy diff with original (ZSQLMethods 3.14)
else:
if not isinstance(v, StringTypes):
v = str(v)
if isinstance(v, six.binary_type):
if six.PY3 and isinstance(v, six.binary_type):
v = v.decode('utf-8')
# The call to sql_quote__ can return something that is not
# a native string anymore!
v = md.getitem('sql_quote__', 0)(v)
if isinstance(v, six.binary_type):
if six.PY3 and isinstance(v, six.binary_type):
v = v.decode('utf-8')
# if v.find("\'") >= 0: v="''".(v.split("\'"))
# v="'%s'" % v
......
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