[Checkins] SVN: z3c.form/trunk/src/z3c/form/browser/select.txt added some tests for missing vocabulary terms
Adam Groszer
cvs-admin at zope.org
Thu Sep 6 09:23:23 UTC 2012
Log message for revision 127742:
added some tests for missing vocabulary terms
Changed:
U z3c.form/trunk/src/z3c/form/browser/select.txt
-=-
Modified: z3c.form/trunk/src/z3c/form/browser/select.txt
===================================================================
--- z3c.form/trunk/src/z3c/form/browser/select.txt 2012-09-06 09:21:01 UTC (rev 127741)
+++ z3c.form/trunk/src/z3c/form/browser/select.txt 2012-09-06 09:23:19 UTC (rev 127742)
@@ -91,6 +91,20 @@
</select>
<input name="widget.name-empty-marker" type="hidden" value="1" />
+Let's see what happens if we have values that are not in the vocabulary:
+
+ >>> widget.value = ['x', 'y']
+ >>> widget.update()
+ >>> print widget.render() # doctest: +NORMALIZE_WHITESPACE
+ <select id="widget-id" name="widget.name:list"
+ class="select-widget" size="1">
+ <option id="widget-id-novalue" value="--NOVALUE--">no value</option>
+ <option id="widget-id-0" value="a">a</option>
+ <option id="widget-id-1" value="b">b</option>
+ <option id="widget-id-2" value="c">c</option>
+ </select>
+ <input name="widget.name-empty-marker" type="hidden" value="1" />
+
Let's now make sure that we can extract user entered data from a widget:
>>> widget.request = TestRequest(form={'widget.name': ['c']})
@@ -255,6 +269,13 @@
<span class="selected-option">c</span>
</span>
+Let's see what happens if we have values that are not in the vocabulary:
+
+ >>> widget.value = ['x', 'y']
+ >>> widget.update()
+ >>> print widget.render() # doctest: +NORMALIZE_WHITESPACE
+ <span id="widget-id" class="select-widget required"></span>
+
Hidden Widget
-------------
@@ -276,3 +297,11 @@
class="hidden-widget" value="b" id="widget-id-1" />
<input name="widget.name-empty-marker" type="hidden"
value="1" />
+
+Let's see what happens if we have values that are not in the vocabulary:
+
+ >>> widget.value = ['x', 'y']
+ >>> widget.update()
+ >>> print widget.render() # doctest: +NORMALIZE_WHITESPACE
+ <input name="widget.name-empty-marker" type="hidden"
+ value="1" />
More information about the checkins
mailing list