Skip to content

Commit

Permalink
add some more tests for richtext widget
Browse files Browse the repository at this point in the history
  • Loading branch information
amleczko committed Feb 13, 2014
1 parent 67885d7 commit 9398f24
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plone/app/widgets/dx.py
Expand Up @@ -726,7 +726,7 @@ def _base_args(self):
properties = getToolByName(self.context, 'portal_properties')
charset = properties.site_properties.getProperty('default_charset',
'utf-8')
value = self.value and self.value.raw or u''
value = self.value and self.value.raw_encoded or ''
args['value'] = (self.request.get(
self.field.getName(), value)).decode(charset)

Expand Down
11 changes: 11 additions & 0 deletions plone/app/widgets/tests/test_dx.py
Expand Up @@ -932,6 +932,17 @@ def test_widget_params(self):
self.assertEqual(base_args['pattern_options']['anchorSelector'],
self.portal.portal_tinymce.anchor_selector)

def test_widget_values(self):
from plone.app.widgets.dx import RichTextWidget
from plone.app.textfield.value import RichTextValue

widget = FieldWidget(self.field, RichTextWidget(self.request))
# set the context so we can get tinymce settings
widget.context = self.portal
widget.value = RichTextValue(u'Lorem ipsum \u2026')
base_args = widget._base_args()
self.assertEquals(base_args['value'], u'Lorem ipsum \u2026')


class DexterityVocabularyPermissionTests(unittest.TestCase):

Expand Down

1 comment on commit 9398f24

@mister-roboto
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TESTS FAILED
Mr.roboto url : http://jenkins.plone.org/roboto/get_info?push=13ce2fde97694dcbae2cf50b9bf9419a
plone-5.0-python-2.7 [FAILURE]

Please sign in to comment.