Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
9a89ac06
Commit
9a89ac06
authored
Jun 04, 2024
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Plain Diff
Changes so that document ids with non-ascii characters work
See merge request
!1950
parents
9d79d571
68630914
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBase.py
.../TestTemplateItem/portal_components/test.erp5.testBase.py
+19
-0
product/CMFActivity/ActivityTool.py
product/CMFActivity/ActivityTool.py
+5
-2
product/ERP5Type/patches/sqltest.py
product/ERP5Type/patches/sqltest.py
+4
-4
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testBase.py
View file @
9a89ac06
...
...
@@ -1405,6 +1405,25 @@ 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
()
# no error in indexation
# Check that the new object is retreivable by its id
self
.
assertEqual
(
obj
.
getId
(),
'tést'
)
self
.
assertIsInstance
(
obj
.
getId
(),
str
)
self
.
assertEqual
(
module
.
_getOb
(
obj
.
getId
()).
getId
(),
obj
.
getId
())
self
.
assertIsInstance
(
module
.
_getOb
(
obj
.
getId
()).
getId
(),
str
)
class
TestERP5PropertyManager
(
unittest
.
TestCase
):
"""Tests for ERP5PropertyManager.
...
...
product/CMFActivity/ActivityTool.py
View file @
9a89ac06
...
...
@@ -27,7 +27,7 @@ from __future__ import absolute_import
#
##############################################################################
from
six
import
string_types
as
basestring
from
Products.ERP5Type.Utils
import
ensure_list
from
Products.ERP5Type.Utils
import
ensure_list
,
str2unicode
import
copy
import
socket
...
...
@@ -359,7 +359,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
())
...
...
product/ERP5Type/patches/sqltest.py
View file @
9a89ac06
...
...
@@ -174,13 +174,13 @@ else: # For easy diff with original (ZSQLMethods 3.14)
else
:
if
not
isinstance
(
v
,
StringTypes
):
v
=
str
(
v
)
if
isinstance
(
v
,
six
.
binary_type
):
v
=
v
.
decode
(
'utf
-8'
)
if
six
.
PY3
and
isinstance
(
v
,
six
.
binary_type
):
v
=
v
.
decode
(
self
.
encoding
or
'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
):
v
=
v
.
decode
(
'utf
-8'
)
if
six
.
PY3
and
isinstance
(
v
,
six
.
binary_type
):
v
=
v
.
decode
(
self
.
encoding
or
'UTF
-8'
)
# if v.find("\'") >= 0: v="''".(v.split("\'"))
# v="'%s'" % v
vs
.
append
(
v
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment