[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form/tests - test_browserwidget.py:1.5 test_checkboxwidget.py:1.4 test_filewidget.py:1.3 test_listwidget.py:1.3 test_multicheckboxwidget.py:1.3 test_multilistwidget.py:1.3 test_passwordwidget.py:1.3 test_radiowidget.py:1.3 test_setprefix.py:1.3 test_textareawidget.py:1.3 test_textwidget.py:1.3

Viktorija Zaksiene ryzaja@codeworks.lt
Wed, 15 Jan 2003 10:44:37 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/form/tests
In directory cvs.zope.org:/tmp/cvs-serv22391/src/zope/app/browser/form/tests

Modified Files:
	test_browserwidget.py test_checkboxwidget.py 
	test_filewidget.py test_listwidget.py 
	test_multicheckboxwidget.py test_multilistwidget.py 
	test_passwordwidget.py test_radiowidget.py test_setprefix.py 
	test_textareawidget.py test_textwidget.py 
Log Message:
Updated all widgets to include id= attribute in the rendering output.  (This
is needed for <label> elements to work correctly, see the HTML4 spec)



=== Zope3/src/zope/app/browser/form/tests/test_browserwidget.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/form/tests/test_browserwidget.py:1.4	Thu Jan  9 09:13:06 2003
+++ Zope3/src/zope/app/browser/form/tests/test_browserwidget.py	Wed Jan 15 10:44:33 2003
@@ -56,7 +56,8 @@
 
     def testRender(self):
         value = 'Foo Value'
-        check_list = ('type="text"', 'name="field.foo"', 'value="Foo Value"')
+        check_list = ('type="text"', 'id="field.foo"', 'name="field.foo"',
+                      'value="Foo Value"')
         self._verifyResult(self._widget.render(value), check_list)
         check_list = ('type="hidden"',) + check_list[1:]
         self._verifyResult(self._widget.renderHidden(value), check_list)


=== Zope3/src/zope/app/browser/form/tests/test_checkboxwidget.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/form/tests/test_checkboxwidget.py:1.3	Mon Dec 30 14:39:48 2002
+++ Zope3/src/zope/app/browser/form/tests/test_checkboxwidget.py	Wed Jan 15 10:44:33 2003
@@ -33,8 +33,8 @@
 
     def testRender(self):
         value = 1
-        check_list = ('type="checkbox"', 'name="field.foo"',
-                      'checked="checked"')
+        check_list = ('type="checkbox"', 'id="field.foo"',
+                      'name="field.foo"', 'checked="checked"')
         self._verifyResult(self._widget.render(value), check_list)
         value = 0
         check_list = check_list[:-1]


=== Zope3/src/zope/app/browser/form/tests/test_filewidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/form/tests/test_filewidget.py:1.2	Wed Dec 25 09:12:32 2002
+++ Zope3/src/zope/app/browser/form/tests/test_filewidget.py	Wed Jan 15 10:44:33 2003
@@ -42,7 +42,8 @@
 
     def testRender(self):
         value = 'Foo Value'
-        check_list = ('type="file"', 'name="field.foo"', 'size="20"')
+        check_list = ('type="file"', 'id="field.foo"', 'name="field.foo"',
+                      'size="20"')
         self._verifyResult(self._widget.render(value), check_list)
         check_list = ('type="hidden"',) + check_list[1:-1]
         self._verifyResult(self._widget.renderHidden(value), check_list)


=== Zope3/src/zope/app/browser/form/tests/test_listwidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/form/tests/test_listwidget.py:1.2	Wed Dec 25 09:12:32 2002
+++ Zope3/src/zope/app/browser/form/tests/test_listwidget.py	Wed Jan 15 10:44:33 2003
@@ -54,12 +54,13 @@
 
     def testRender(self):
         value = 'foo'
-        check_list = ('select', 'name="field.foo"', 'size="5"',
-                      'option', 'value="foo"', '>foo<',
+        check_list = ('select', 'id="field.foo"', 'name="field.foo"',
+                      'size="5"', 'option', 'value="foo"', '>foo<',
                       'value="foo"', '>bar<', 'selected="selected"')
         self._verifyResult(self._widget.render(value), check_list)
 
-        check_list = ('type="hidden"', 'name="field.foo"', 'value="foo"')
+        check_list = ('type="hidden"', 'id="field.foo"', 'name="field.foo"',
+                      'value="foo"')
         self._verifyResult(self._widget.renderHidden(value), check_list)
         check_list = ('style="color: red"',) + check_list
         self._widget.extra = 'style="color: red"'


=== Zope3/src/zope/app/browser/form/tests/test_multicheckboxwidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/form/tests/test_multicheckboxwidget.py:1.2	Wed Dec 25 09:12:32 2002
+++ Zope3/src/zope/app/browser/form/tests/test_multicheckboxwidget.py	Wed Jan 15 10:44:33 2003
@@ -34,8 +34,8 @@
 
 
     def testRenderItem(self):
-        check_list = ('type="checkbox"', 'name="field.bar"', 'value="foo"',
-                      'Foo')
+        check_list = ('type="checkbox"', 'id="field.bar"',
+                      'name="field.bar"', 'value="foo"', 'Foo')
         self._verifyResult(
             self._widget.renderItem('Foo', 'foo', 'field.bar', None),
             check_list)
@@ -46,19 +46,22 @@
 
 
     def testRenderItems(self):
-        check_list = ('type="checkbox"', 'name="field.foo"', 'value="bar"',
-                      'bar', 'value="foo"', 'foo', 'checked="checked"')
+        check_list = ('type="checkbox"', 'id="field.foo"',
+                      'name="field.foo"', 'value="bar"', 'bar',
+                      'value="foo"', 'foo', 'checked="checked"')
         self._verifyResult('\n'.join(self._widget.renderItems('bar')),
                            check_list)
 
 
     def testRender(self):
         value = 'bar'
-        check_list = ('type="checkbox"', 'name="field.foo"', 'value="bar"',
-                      'bar', 'value="foo"', 'foo', 'checked="checked"')
+        check_list = ('type="checkbox"', 'id="field.foo"',
+                      'name="field.foo"', 'value="bar"', 'bar',
+                      'value="foo"', 'foo', 'checked="checked"')
         self._verifyResult(self._widget.render(value), check_list)
 
-        check_list = ('type="hidden"', '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"'


=== Zope3/src/zope/app/browser/form/tests/test_multilistwidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/form/tests/test_multilistwidget.py:1.2	Wed Dec 25 09:12:32 2002
+++ Zope3/src/zope/app/browser/form/tests/test_multilistwidget.py	Wed Jan 15 10:44:33 2003
@@ -53,13 +53,14 @@
 
     def testRender(self):
         value = 'foo'
-        check_list = ('select', 'name="field.foo"', 'size="5"',
-                      'option', 'value="foo"', '>foo<',
+        check_list = ('select', 'id="field.foo"', 'name="field.foo"',
+                      'size="5"', 'option', 'value="foo"', '>foo<',
                       'value="foo"', '>bar<', 'selected="selected"',
                       'multiple="multiple"')
         self._verifyResult(self._widget.render(value), check_list)
 
-        check_list = ('type="hidden"', 'name="field.foo"', 'value="foo"')
+        check_list = ('type="hidden"', 'id="field.foo"', 'name="field.foo"',
+                      'value="foo"')
         self._verifyResult(self._widget.renderHidden(value), check_list)
         check_list = ('style="color: red"',) + check_list
         self._widget.extra = 'style="color: red"'


=== Zope3/src/zope/app/browser/form/tests/test_passwordwidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/form/tests/test_passwordwidget.py:1.2	Wed Dec 25 09:12:32 2002
+++ Zope3/src/zope/app/browser/form/tests/test_passwordwidget.py	Wed Jan 15 10:44:33 2003
@@ -35,8 +35,8 @@
 
     def testRender(self):
         value = 'Foo Value'
-        check_list = ('type="password"', 'name="field.foo"',
-                      'value="Foo Value"', 'size="20"')
+        check_list = ('type="password"', 'id="field.foo"',
+                      'name="field.foo"', 'value="Foo Value"', 'size="20"')
         self._verifyResult(self._widget.render(value), check_list)
         check_list = ('type="hidden"',) + check_list[1:-1]
         self._verifyResult(self._widget.renderHidden(value), check_list)


=== Zope3/src/zope/app/browser/form/tests/test_radiowidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/form/tests/test_radiowidget.py:1.2	Wed Dec 25 09:12:32 2002
+++ Zope3/src/zope/app/browser/form/tests/test_radiowidget.py	Wed Jan 15 10:44:33 2003
@@ -35,8 +35,8 @@
 
 
     def testRenderItem(self):
-        check_list = ('type="radio"', 'name="field.bar"', 'value="foo"',
-                      'Foo')
+        check_list = ('type="radio"', 'id="field.bar"', 'name="field.bar"',
+                      'value="foo"', 'Foo')
         self._verifyResult(
             self._widget.renderItem('Foo', 'foo', 'field.bar', None),
             check_list)
@@ -47,19 +47,22 @@
 
 
     def testRenderItems(self):
-        check_list = ('type="radio"', 'name="field.foo"', 'value="bar"',
-                      'bar', 'value="foo"', 'foo', 'checked="checked"')
+        check_list = ('type="radio"', 'id="field.foo"', 'name="field.foo"',
+                      'value="bar"', 'bar', 'value="foo"', 'foo',
+                      'checked="checked"')
         self._verifyResult('\n'.join(self._widget.renderItems('bar')),
                            check_list)
 
 
     def testRender(self):
         value = 'bar'
-        check_list = ('type="radio"', 'name="field.foo"', 'value="bar"',
-                      'bar', 'value="foo"', 'foo', 'checked="checked"')
+        check_list = ('type="radio"', 'id="field.foo"', 'name="field.foo"',
+                      'value="bar"', 'bar', 'value="foo"', 'foo',
+                      'checked="checked"')
         self._verifyResult(self._widget.render(value), check_list)
 
-        check_list = ('type="hidden"', '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"'


=== Zope3/src/zope/app/browser/form/tests/test_setprefix.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/form/tests/test_setprefix.py:1.2	Wed Dec 25 09:12:32 2002
+++ Zope3/src/zope/app/browser/form/tests/test_setprefix.py	Wed Jan 15 10:44:33 2003
@@ -35,8 +35,8 @@
 
     def testRender(self):
         value = 'Foo Value 2'
-        check_list = ('type="text"', 'name="spam.foo"', 'value="Foo Value 2"',
-                      'size="20"')
+        check_list = ('type="text"', 'id="spam.foo"', 'name="spam.foo"',
+                      'value="Foo Value 2"', 'size="20"')
         self._widget.setData(value)
         self._verifyResult(self._widget(), check_list)
         check_list = ('type="hidden"',) + check_list[1:-1]


=== Zope3/src/zope/app/browser/form/tests/test_textareawidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/form/tests/test_textareawidget.py:1.2	Wed Dec 25 09:12:32 2002
+++ Zope3/src/zope/app/browser/form/tests/test_textareawidget.py	Wed Jan 15 10:44:33 2003
@@ -34,12 +34,14 @@
 
     def testRender(self):
         value = "Foo Value"
-        check_list = ('rows="15"', 'cols="60"', 'name="field.foo"', 'textarea')
+        check_list = ('rows="15"', 'cols="60"', 'id="field.foo"',
+                      'name="field.foo"', 'textarea')
         self._verifyResult(self._widget.render(value), check_list)
         check_list = ('style="color: red"',) + check_list
         self._widget.extra = 'style="color: red"'
         self._verifyResult(self._widget.render(value), check_list)
-        check_list = ('type="hidden"', 'name="field.foo"', 'value="Foo Value"')
+        check_list = ('type="hidden"', 'id="field.foo"', 'name="field.foo"',
+                      'value="Foo Value"')
         self._verifyResult(self._widget.renderHidden(value), check_list)
 
     def testRow(self):


=== Zope3/src/zope/app/browser/form/tests/test_textwidget.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/form/tests/test_textwidget.py:1.2	Wed Dec 25 09:12:32 2002
+++ Zope3/src/zope/app/browser/form/tests/test_textwidget.py	Wed Jan 15 10:44:33 2003
@@ -35,8 +35,8 @@
 
     def testRender(self):
         value = 'Foo Value'
-        check_list = ('type="text"', 'name="field.foo"', 'value="Foo Value"',
-                      'size="20"')
+        check_list = ('type="text"', 'id="field.foo"', 'name="field.foo"',
+                      'value="Foo Value"', 'size="20"')
         self._verifyResult(self._widget.render(value), check_list)
         check_list = ('type="hidden"',) + check_list[1:-1]
         self._verifyResult(self._widget.renderHidden(value), check_list)