[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/form/browser/tests/test_textwidget.py
TestCase for the rendering of bytesarea field demonstrating
it works with the default display widget. Change as well to
unicode the value for the textarea testcase to see th difference
Julien Anguenot
ja at nuxeo.com
Mon Jul 25 10:27:07 EDT 2005
Log message for revision 37406:
TestCase for the rendering of bytesarea field demonstrating it works with the default display widget. Change as well to unicode the value for the textarea testcase to see th difference
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:11:18 UTC (rev 37405)
+++ Zope3/trunk/src/zope/app/form/browser/tests/test_textwidget.py 2005-07-25 14:27:07 UTC (rev 37406)
@@ -27,6 +27,8 @@
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 DateDisplayWidget
from zope.app.form.browser import DatetimeDisplayWidget
from zope.app.form.browser import URIDisplayWidget
@@ -235,6 +237,31 @@
# Rendering with the default DisplayWidget for this widget
def testRender(self):
+ value = u"""
+ texttexttexttexttexttextexttexttexttexttextéééééééééééééééé
+ texttexttexttexttextteéééééxttexttexttexttexttexttexttextte
+ texttexttexttexttexttexttexttexttexttexttexttexttexttexttext
+ """
+ self._widget.setRenderedValue(value)
+ self.assert_(value, self._widget._toFieldValue(value))
+ self.verifyResult(self._widget(), ["<textarea",
+ self._widget._toFormValue(value)])
+ check_list = (
+ ('id', 'field.foo'),
+ ('name', 'field.foo'),
+ #('value', ), tested above
+ ('cols', '60'),
+ ('rows', '15'),
+ )
+ for a, v in check_list:
+ self.verifyResult(self._widget(), [a, v])
+
+class BytesAreaDisplayWidgetTest(BrowserWidgetTest):
+
+ _WidgetFactory = BytesAreaWidget
+
+ # Rendering with the default DisplayWidget for this widget
+ def testRender(self):
value = """
texttexttexttexttexttexttexttexttexttexttexttexttexttexttext
texttexttexttexttexttexttexttexttexttexttexttexttexttexttext
@@ -306,6 +333,7 @@
unittest.makeSuite(DateDisplayWidgetTest),
unittest.makeSuite(DatetimeDisplayWidgetTest),
unittest.makeSuite(TextAreaDisplayWidgetTest),
+ unittest.makeSuite(BytesAreaDisplayWidgetTest),
doctest.DocTestSuite(),
))
More information about the Zope3-Checkins
mailing list