fix test in py3

This commit is contained in:
Philip Bauer 2018-09-20 18:31:23 +02:00
parent 7396abf6cf
commit 08b6db8b67

View File

@ -33,8 +33,6 @@ from zope.i18n import translate
from zope.i18nmessageid import Message from zope.i18nmessageid import Message
from zope.interface import alsoProvides from zope.interface import alsoProvides
import six
COMMENT_DESCRIPTION_PLAIN_TEXT = _( COMMENT_DESCRIPTION_PLAIN_TEXT = _(
u'comment_description_plain_text', u'comment_description_plain_text',
@ -168,11 +166,9 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
fullname = member.getProperty('fullname') fullname = member.getProperty('fullname')
if not fullname or fullname == '': if not fullname or fullname == '':
fullname = member.getUserName() fullname = member.getUserName()
elif isinstance(fullname, str): fullname = safe_unicode(fullname)
fullname = six.text_type(fullname, 'utf-8')
author_name = fullname author_name = fullname
if email and isinstance(email, str): email = safe_unicode(email)
email = six.text_type(email, 'utf-8')
# XXX: according to IComment interface author_email must not be # noqa T000 # XXX: according to IComment interface author_email must not be # noqa T000
# set for logged in users, cite: # set for logged in users, cite:
# 'for anonymous comments only, set to None for logged in comments' # 'for anonymous comments only, set to None for logged in comments'