Permalink
Browse files

fixing testcase for the new funcionality

  • Loading branch information...
1 parent 1687080 commit 12e4dc369b610c7c4963e1e151896a79870223a0 @Quimera Quimera committed Jan 12, 2013
Showing with 14 additions and 27 deletions.
  1. +14 −27 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():

0 comments on commit 12e4dc3

Please sign in to comment.