Commit 8e831497 authored by Jérome Perrin's avatar Jérome Perrin

web_renderjs_ui: py3

parent e617bcdb
......@@ -24,7 +24,7 @@ if not isinstance(deny_tag_list, (list, tuple)):
deny_tag_list = []
def main(data):
if isinstance(data, str):
if isinstance(data, bytes):
data = data.decode("utf-8")
for part in context.Base_parseHtml(data):
handleHtmlPart(part)
......
......@@ -12,7 +12,7 @@ def ERP5Site_extractTranslationMessageListFromHTML(self, text_content):
"""
if not text_content:
return
if isinstance(text_content, str):
if isinstance(text_content, bytes):
text_content = text_content.decode('utf-8')
parser = lxml.etree.HTMLParser()
......
......@@ -74,7 +74,7 @@
</div>
<div class="dialog_button_container">
<input type="submit" value="Login" i18n:attributes="value" i18n:domain="ui" tal:attributes="name python: '%s:method' % (form_action, )"/>
<a i18n:domain="ui" i18n:translate="" tal:attributes="href python: '%sWebSite_viewRecoverAccount?%s' % (absolute_url, modules['urllib'].urlencode([('came_from', absolute_url)]))">I forgot my password!</a>
<a i18n:domain="ui" i18n:translate="" tal:attributes="href python: '%sWebSite_viewRecoverAccount?%s' % (absolute_url, modules['six.moves.urllib.parse'].urlencode([('came_from', absolute_url)]))">I forgot my password!</a>
</div>
<div class="dialog_button_container" tal:condition="enable_google_login">
<a tal:attributes="href python: root_absolute_url + 'ERP5Site_redirectToGoogleLoginPage'"
......
......@@ -25,9 +25,9 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from six.moves import cStringIO as StringIO
import textwrap
import time
import io
from Products.ERP5Type.tests.utils import createZODBPythonScript
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
......@@ -332,12 +332,12 @@ class TestRenderUpdateTranslationData(RenderJSUpgradeTestCase):
def test_WebSite_getTranslationDataTextContent_extract_from_file(self):
self.portal.portal_skins.custom.manage_addProduct['OFS'].manage_addFile(
'test_portal_skins_gadget.html',
file=StringIO(textwrap.dedent('''
file=io.BytesIO(textwrap.dedent('''
<html>
<!--
data-i18n=Message from file
-->
</html>''')))
</html>''').encode()))
self.portal.changeSkin(None) # refresh skin cache
translation_data_text_content = self.web_site.WebSite_getTranslationDataTextContent()
self.assertIn('"Message from file":', translation_data_text_content)
......
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