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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
8098941a
Commit
8098941a
authored
Oct 21, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into zope4py2
parents
e16c35c5
0162ede8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testZODBHistory.py
...mplateItem/portal_components/test.erp5.testZODBHistory.py
+11
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getZODBHistoryList.py
...ateItem/portal_skins/erp5_core/Base_getZODBHistoryList.py
+2
-2
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testZODBHistory.py
View file @
8098941a
...
...
@@ -134,6 +134,17 @@ class TestZODBHistory(ERP5TypeTestCase):
from
zExceptions
import
Unauthorized
self
.
assertRaises
(
Unauthorized
,
document
.
Base_viewZODBHistory
)
def
test_ZODBHistoryNonAsciiProperty
(
self
):
self
.
loginByUserName
(
'tatuya'
)
document
=
self
.
addOrganisation
(
self
.
id
())
document
.
edit
(
title
=
'ネクセディ'
,
default_address_city
=
'千代田区'
)
self
.
commit
()
_
,
change
,
=
document
.
Base_getZODBHistoryList
()
self
.
assertIn
(
'title:ネクセディ'
,
change
.
getProperty
(
'changes'
))
# no encoding error
document
.
Base_viewZODBHistory
()
def
test_ZODBHistoryBinaryData
(
self
):
"""
Make sure ZODB History view works with binary content
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getZODBHistoryList.py
View file @
8098941a
...
...
@@ -13,10 +13,10 @@ def beautifyChange(change_dict):
for
property_name
,
property_value
in
sorted
(
change_dict
.
items
()):
if
isinstance
(
property_value
,
six
.
binary_type
):
try
:
property_value
=
six
.
text_type
(
property_value
,
'utf-8'
)
six
.
text_type
(
property_value
,
'utf-8'
)
except
UnicodeDecodeError
:
property_value
=
'(binary)'
change_list
.
append
(
'
%s:%s'
%
(
property_name
,
property_value
))
change_list
.
append
(
'
{}:{}'
.
format
(
property_name
,
property_value
))
return
change_list
try
:
...
...
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