[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form/tests - test_listwidget.py:1.4 test_multicheckboxwidget.py:1.4 test_multilistwidget.py:1.4 test_radiowidget.py:1.4
Steve Alexander
steve@cat-box.net
Thu, 20 Feb 2003 09:45:45 -0500
Update of /cvs-repository/Zope3/src/zope/app/browser/form/tests
In directory cvs.zope.org:/tmp/cvs-serv991/src/zope/app/browser/form/tests
Modified Files:
test_listwidget.py test_multicheckboxwidget.py
test_multilistwidget.py test_radiowidget.py
Log Message:
Made the labels on radio button widgets work as expected, rather than
having clicking the 'label' for the whole set of buttons select the
first button.
=== Zope3/src/zope/app/browser/form/tests/test_listwidget.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/form/tests/test_listwidget.py:1.3 Wed Jan 15 10:44:33 2003
+++ Zope3/src/zope/app/browser/form/tests/test_listwidget.py Thu Feb 20 09:45:44 2003
@@ -37,11 +37,12 @@
def testRenderItem(self):
check_list = ('option', 'value="foo"', 'Foo')
self._verifyResult(
- self._widget.renderItem('Foo', 'foo', 'field.bar', None),
+ self._widget.renderItem(0, 'Foo', 'foo', 'field.bar', None),
check_list)
check_list += ('selected="selected"',)
self._verifyResult(
- self._widget.renderSelectedItem('Foo', 'foo', 'field.bar', None),
+ self._widget.renderSelectedItem(
+ 0, 'Foo', 'foo', 'field.bar', None),
check_list)
=== Zope3/src/zope/app/browser/form/tests/test_multicheckboxwidget.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/form/tests/test_multicheckboxwidget.py:1.3 Wed Jan 15 10:44:33 2003
+++ Zope3/src/zope/app/browser/form/tests/test_multicheckboxwidget.py Thu Feb 20 09:45:44 2003
@@ -37,11 +37,12 @@
check_list = ('type="checkbox"', 'id="field.bar"',
'name="field.bar"', 'value="foo"', 'Foo')
self._verifyResult(
- self._widget.renderItem('Foo', 'foo', 'field.bar', None),
+ self._widget.renderItem(0, 'Foo', 'foo', 'field.bar', None),
check_list)
check_list += ('checked="checked"',)
self._verifyResult(
- self._widget.renderSelectedItem('Foo', 'foo', 'field.bar', None),
+ self._widget.renderSelectedItem(
+ 0, 'Foo', 'foo', 'field.bar', None),
check_list)
=== Zope3/src/zope/app/browser/form/tests/test_multilistwidget.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/form/tests/test_multilistwidget.py:1.3 Wed Jan 15 10:44:33 2003
+++ Zope3/src/zope/app/browser/form/tests/test_multilistwidget.py Thu Feb 20 09:45:44 2003
@@ -36,13 +36,13 @@
def testRenderItem(self):
check_list = ('option', 'value="foo"', 'Foo')
self._verifyResult(
- self._widget.renderItem('Foo', 'foo', 'field.bar', None),
+ self._widget.renderItem(0, 'Foo', 'foo', 'field.bar', None),
check_list)
check_list += ('selected="selected"',)
self._verifyResult(
- self._widget.renderSelectedItem('Foo', 'foo', 'field.bar', None),
+ self._widget.renderSelectedItem(
+ 0, 'Foo', 'foo', 'field.bar', None),
check_list)
-
def testRenderItems(self):
check_list = ('option', 'value="foo"', 'bar',
=== Zope3/src/zope/app/browser/form/tests/test_radiowidget.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/form/tests/test_radiowidget.py:1.3 Wed Jan 15 10:44:33 2003
+++ Zope3/src/zope/app/browser/form/tests/test_radiowidget.py Thu Feb 20 09:45:44 2003
@@ -35,19 +35,20 @@
def testRenderItem(self):
- check_list = ('type="radio"', 'id="field.bar"', 'name="field.bar"',
- 'value="foo"', 'Foo')
+ check_list = ('type="radio"', 'id="field.bar.0"',
+ 'name="field.bar"', 'value="foo"', 'Foo')
self._verifyResult(
- self._widget.renderItem('Foo', 'foo', 'field.bar', None),
+ self._widget.renderItem(0, 'Foo', 'foo', 'field.bar', None),
check_list)
check_list += ('checked="checked"',)
self._verifyResult(
- self._widget.renderSelectedItem('Foo', 'foo', 'field.bar', None),
+ self._widget.renderSelectedItem(
+ 0, 'Foo', 'foo', 'field.bar', None),
check_list)
def testRenderItems(self):
- check_list = ('type="radio"', 'id="field.foo"', 'name="field.foo"',
+ check_list = ('type="radio"', 'id="field.foo.0"', 'name="field.foo"',
'value="bar"', 'bar', 'value="foo"', 'foo',
'checked="checked"')
self._verifyResult('\n'.join(self._widget.renderItems('bar')),
@@ -56,13 +57,13 @@
def testRender(self):
value = 'bar'
- check_list = ('type="radio"', 'id="field.foo"', 'name="field.foo"',
- 'value="bar"', 'bar', 'value="foo"', 'foo',
- 'checked="checked"')
+ check_list = ('type="radio"', 'id="field.foo.0"',
+ 'name="field.foo"', 'value="bar"', 'bar',
+ 'value="foo"', 'foo', 'checked="checked"')
self._verifyResult(self._widget.render(value), check_list)
- check_list = ('type="hidden"', 'id="field.foo"', 'name="field.foo"',
- 'value="bar"')
+ check_list = ('type="hidden"', 'id="field.foo"',
+ 'name="field.foo"', 'value="bar"')
self._verifyResult(self._widget.renderHidden(value), check_list)
check_list = ('style="color: red"',) + check_list
self._widget.extra = 'style="color: red"'