Commit 8098941a authored by Jérome Perrin's avatar Jérome Perrin

Merge remote-tracking branch 'upstream/master' into zope4py2

parents e16c35c5 0162ede8
......@@ -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
......
......@@ -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:
......
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