Skip to content

Commit

Permalink
more test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
projekt01 committed Feb 10, 2009
1 parent f1e9719 commit f6f19ba
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/z3c/form/browser/textlines.txt
Expand Up @@ -54,3 +54,43 @@ Adding some more attributes to the widget will make it display more:
>>> print widget.render()
<textarea id="id" name="name" class="textarea-widget">foo
bar</textarea>


TextLinesFieldWidget
--------------------

The field widget needs a field:

>>> import zope.schema
>>> text = zope.schema.List(
... title=u'List',
... value_type=zope.schema.TextLine())

>>> widget = textlines.TextLinesFieldWidget(text, request)
>>> widget
<TextLinesWidget ''>

>>> widget.id = 'id'
>>> widget.name = 'name'
>>> widget.value = u'foo\nbar'

>>> print widget.render()
<textarea id="id" name="name" class="textarea-widget">foo
bar</textarea>


TextLinesFieldWidgetFactory
---------------------------

>>> widget = textlines.TextLinesFieldWidgetFactory(text, text.value_type,
... request)
>>> widget
<TextLinesWidget ''>

>>> widget.id = 'id'
>>> widget.name = 'name'
>>> widget.value = u'foo\nbar'

>>> print widget.render()
<textarea id="id" name="name" class="textarea-widget">foo
bar</textarea>

0 comments on commit f6f19ba

Please sign in to comment.