Skip to content

Commit

Permalink
fixing testcase for the new funcionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Quimera committed Jan 12, 2013
1 parent 1687080 commit 12e4dc3
Showing 1 changed file with 14 additions and 27 deletions.
41 changes: 14 additions & 27 deletions src/collective/z3cform/widgets/tests/test_simple_rich_text.py
Expand Up @@ -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
Expand All @@ -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():
Expand Down

0 comments on commit 12e4dc3

Please sign in to comment.