Blaise Laflamme committed 5c45703

Fixed css_class in Widget, added selenium test.

  • Participants
  • Parent commits 6ca1a02

Comments (0)

Files changed (4)

   a text input that can be supplied a URL or iterable of choices to
   ease the search and selection of a finite set of choices.
+- The ``deform.widget.Widget`` class now accepts an extra keyword argument in
+  its constructor: ``css_class``.
+  If ``css_class`` contains a value, the rendered widget will get a class
+  attribute equal to the value.

File deform/

     hidden = False
     category = 'default'
     error_class = 'error'
-    css_class = ''
+    css_class = None
     def __init__(self, **kw):

File deformdemo/

     @bfg_view(renderer='templates/', name='textinput_with_css_class')
     @demonstrate('Text Input Widget with CSS Class')
-    def textinput(self):
+    def textinput_with_css_class(self):
         class Schema(colander.Schema):
             text = colander.SchemaNode(colander.String(),

File deformdemo/tests/

         captured = browser.get_text('css=#captured')
         self.assertEqual(captured, "{'text': u'hello'}")
+class TextInputWithCssClassWidgetTests(unittest.TestCase):
+    url = "/textinput_with_css_class/"
+    def test_render_default(self):
+        browser.wait_for_page_to_load("30000")
+        self.assertTrue(browser.is_element_present('css=.deformWidgetWithStyle'))
 class AutocompleteInputWidgetTests(unittest.TestCase):
     url = "/autocomplete_input/"
     def test_render_default(self):