Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixing testcase for the new funcionality

  • Loading branch information...
commit 12e4dc369b610c7c4963e1e151896a79870223a0 1 parent 1687080
Silvestre Huens authored January 12, 2013
41  src/collective/z3cform/widgets/tests/test_simple_rich_text.py
@@ -17,7 +17,7 @@ class WidgetTest(unittest.TestCase):
17 17
     def setUp(self):
18 18
         self.portal = self.layer['portal']
19 19
 
20  
-    def test_js(self):
  20
+    def test_configuration(self):
21 21
         from collective.z3cform.widgets.simple_rich_text import \
22 22
             SimpleRichTextWidget, SimpleRichText
23 23
         portal = self.portal
@@ -32,32 +32,19 @@ def test_js(self):
32 32
         widget.id = 'test'
33 33
         widget.field = SimpleRichText()
34 34
 
35  
-        result = widget.rte_js()
36  
-
37  
-        rte_js_init = """\
38  
-        $("#%(id)s").rte({
39  
-            content_css_url: "++resource++collective.z3cform.widgets/rte.css",
40  
-            media_url: "++resource++collective.z3cform.widgets/rte/",
41  
-            iframe_height: %(iframe_height)s,
42  
-            format_block: %(format_block)s,
43  
-            bold: %(bold)s,
44  
-            italic: %(italic)s,
45  
-            unordered_list: %(unordered_list)s,
46  
-            link: %(link)s,
47  
-            image: %(image)s,
48  
-            allow_disable: %(allow_disable)s
49  
-        });
50  
-        """
51  
-
52  
-        self.assertEqual(result, rte_js_init % dict(id='test',
53  
-                                                    iframe_height=100,
54  
-                                                    format_block='true',
55  
-                                                    bold='true',
56  
-                                                    italic='true',
57  
-                                                    unordered_list='true',
58  
-                                                    link='true',
59  
-                                                    image='true',
60  
-                                                    allow_disable='true'))
  35
+        result = widget.rte_conf()
  36
+        conf = {
  37
+            'iframe_height': 100,
  38
+            'format_block': 'true',
  39
+            'bold': 'true',
  40
+            'italic': 'true',
  41
+            'unordered_list': 'true',
  42
+            'link': 'true',
  43
+            'image': 'true',
  44
+            'allow_disable': 'true'
  45
+        }
  46
+
  47
+        self.assertEqual(result, conf)
61 48
 
62 49
 
63 50
 def test_suite():

0 notes on commit 12e4dc3

Please sign in to comment.
Something went wrong with that request. Please try again.