[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/form/browser/tests/test_textwidget.py
TestCase for the rendering of password field demonstrating it
works with the default display widget
Julien Anguenot
ja at nuxeo.com
Mon Jul 25 10:34:44 EDT 2005
Log message for revision 37408:
TestCase for the rendering of password field demonstrating it works with the default display widget
Changed:
U Zope3/trunk/src/zope/app/form/browser/tests/test_textwidget.py
-=-
Modified: Zope3/trunk/src/zope/app/form/browser/tests/test_textwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/tests/test_textwidget.py 2005-07-25 14:33:26 UTC (rev 37407)
+++ Zope3/trunk/src/zope/app/form/browser/tests/test_textwidget.py 2005-07-25 14:34:44 UTC (rev 37408)
@@ -28,6 +28,7 @@
from zope.app.form.browser import TextWidget
from zope.app.form.browser import TextAreaWidget
from zope.app.form.browser import BytesAreaWidget
+from zope.app.form.browser import PasswordWidget
from zope.app.form.browser import DateDisplayWidget
from zope.app.form.browser import DatetimeDisplayWidget
@@ -37,7 +38,6 @@
from zope.app.form.browser.tests.test_browserwidget import BrowserWidgetTest
from zope.app.form.browser.tests.test_browserwidget import SimpleInputWidgetTest
-
class TextWidgetTest(SimpleInputWidgetTest):
"""Documents and tests the text widget.
>>> setUp()
@@ -281,6 +281,17 @@
for a, v in check_list:
self.verifyResult(self._widget(), [a, v])
+class PasswordDisplayWidgetTest(BrowserWidgetTest):
+
+ _WidgetFactory = PasswordWidget
+
+ def testRender(self):
+ value = 'Foo Value'
+ self._widget.setRenderedValue(value)
+ check_list = ('type="password"', 'id="field.foo"', 'name="field.foo"',
+ 'value=""', 'size="20"')
+ self.verifyResult(self._widget(), check_list)
+
def test_w_nonrequired_and_missing_value_and_no_inout():
"""
There was a bug that caused the value attribute to be set to
@@ -334,6 +345,7 @@
unittest.makeSuite(DatetimeDisplayWidgetTest),
unittest.makeSuite(TextAreaDisplayWidgetTest),
unittest.makeSuite(BytesAreaDisplayWidgetTest),
+ unittest.makeSuite(PasswordDisplayWidgetTest),
doctest.DocTestSuite(),
))
More information about the Zope3-Checkins
mailing list