From 12e4dc369b610c7c4963e1e151896a79870223a0 Mon Sep 17 00:00:00 2001 From: quimera Date: Sat, 12 Jan 2013 16:11:21 -0300 Subject: [PATCH] fixing testcase for the new funcionality --- .../widgets/tests/test_simple_rich_text.py | 41 +++++++------------ 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/src/collective/z3cform/widgets/tests/test_simple_rich_text.py b/src/collective/z3cform/widgets/tests/test_simple_rich_text.py index 37c8a18..0e74a87 100644 --- a/src/collective/z3cform/widgets/tests/test_simple_rich_text.py +++ b/src/collective/z3cform/widgets/tests/test_simple_rich_text.py @@ -17,7 +17,7 @@ class WidgetTest(unittest.TestCase): def setUp(self): self.portal = self.layer['portal'] - def test_js(self): + def test_configuration(self): from collective.z3cform.widgets.simple_rich_text import \ SimpleRichTextWidget, SimpleRichText portal = self.portal @@ -32,32 +32,19 @@ def test_js(self): widget.id = 'test' widget.field = SimpleRichText() - result = widget.rte_js() - - rte_js_init = """\ - $("#%(id)s").rte({ - content_css_url: "++resource++collective.z3cform.widgets/rte.css", - media_url: "++resource++collective.z3cform.widgets/rte/", - iframe_height: %(iframe_height)s, - format_block: %(format_block)s, - bold: %(bold)s, - italic: %(italic)s, - unordered_list: %(unordered_list)s, - link: %(link)s, - image: %(image)s, - allow_disable: %(allow_disable)s - }); - """ - - self.assertEqual(result, rte_js_init % dict(id='test', - iframe_height=100, - format_block='true', - bold='true', - italic='true', - unordered_list='true', - link='true', - image='true', - allow_disable='true')) + result = widget.rte_conf() + conf = { + 'iframe_height': 100, + 'format_block': 'true', + 'bold': 'true', + 'italic': 'true', + 'unordered_list': 'true', + 'link': 'true', + 'image': 'true', + 'allow_disable': 'true' + } + + self.assertEqual(result, conf) def test_suite():