[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form/tests - test_browserwidget.py:1.11
Jim Fulton
jim@zope.com
Thu, 22 May 2003 18:49:05 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/form/tests
In directory cvs.zope.org:/tmp/cvs-serv12528/src/zope/app/browser/form/tests
Modified Files:
test_browserwidget.py
Log Message:
Fixed bugs in the Checkbox widget. It didn't properly reflect current
data.
Fixed a bug (reported by Guido) in handling conversion of line endings
between web forms and regular data.
Added a number of additioanl tests.
=== Zope3/src/zope/app/browser/form/tests/test_browserwidget.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/browser/form/tests/test_browserwidget.py:1.10 Fri Apr 4 10:39:29 2003
+++ Zope3/src/zope/app/browser/form/tests/test_browserwidget.py Thu May 22 18:49:04 2003
@@ -26,6 +26,7 @@
from zope.schema import Text
import os
import unittest
+from zope.testing.doctestunit import DocTestSuite
import zope.app.browser.form.tests
class BrowserWidgetTest(PlacelessSetup, unittest.TestCase):
@@ -66,12 +67,13 @@
value = 'Foo Value'
check_list = ('type="text"', 'id="field.foo"', 'name="field.foo"',
'value="Foo Value"')
- self._verifyResult(self._widget.render(value), check_list)
+ self._widget.setData(value)
+ self._verifyResult(self._widget(), check_list)
check_list = ('type="hidden"',) + check_list[1:]
- self._verifyResult(self._widget.renderHidden(value), check_list)
+ self._verifyResult(self._widget.hidden(), check_list)
check_list = ('type="hidden"', 'style="color: red"') + check_list[1:]
self._widget.extra = 'style="color: red"'
- self._verifyResult(self._widget.renderHidden(value), check_list)
+ self._verifyResult(self._widget.hidden(), check_list)
def testLabel(self):
label = ' '.join(self._widget.label().strip().split())
@@ -161,7 +163,10 @@
def test_suite():
- return unittest.makeSuite(Test)
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(Test))
+ suite.addTest(DocTestSuite("zope.app.browser.form.widget"))
+ return suite
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')