diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-06-18 16:33:04 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-06-18 16:33:04 +0000 |
| commit | 1a75b5a03caf5924b40801b34d7f3f6011ecac29 (patch) | |
| tree | 6384ec93da7b0b47ba2375c0658df1d265008e36 /tests/regressiontests/forms/widgets.py | |
| parent | 2b62e945b09ef56e5a28389ad049deec1c347cec (diff) | |
Fixed #4860: added 'for' attributes to labels in newforms widgets. Thanks to Ivan Sagalaev and batiste@dosimple.ch for the patches.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7693 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms/widgets.py')
| -rw-r--r-- | tests/regressiontests/forms/widgets.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/regressiontests/forms/widgets.py b/tests/regressiontests/forms/widgets.py index c83fe40928..2c6b51a8ec 100644 --- a/tests/regressiontests/forms/widgets.py +++ b/tests/regressiontests/forms/widgets.py @@ -741,20 +741,20 @@ u'<ul>\n<li><label><input checked="checked" type="radio" name="email" value="\u0 >>> w = RadioSelect(attrs={'id':'foo'}) >>> print w.render('beatle', 'J', choices=(('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo'))) <ul> -<li><label><input checked="checked" type="radio" id="foo_0" value="J" name="beatle" /> John</label></li> -<li><label><input type="radio" id="foo_1" value="P" name="beatle" /> Paul</label></li> -<li><label><input type="radio" id="foo_2" value="G" name="beatle" /> George</label></li> -<li><label><input type="radio" id="foo_3" value="R" name="beatle" /> Ringo</label></li> +<li><label for="foo_0"><input checked="checked" type="radio" id="foo_0" value="J" name="beatle" /> John</label></li> +<li><label for="foo_1"><input type="radio" id="foo_1" value="P" name="beatle" /> Paul</label></li> +<li><label for="foo_2"><input type="radio" id="foo_2" value="G" name="beatle" /> George</label></li> +<li><label for="foo_3"><input type="radio" id="foo_3" value="R" name="beatle" /> Ringo</label></li> </ul> # Attributes provided at render-time are passed to the constituent inputs >>> w = RadioSelect() >>> print w.render('beatle', 'J', choices=(('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo')), attrs={'id':'bar'}) <ul> -<li><label><input checked="checked" type="radio" id="bar_0" value="J" name="beatle" /> John</label></li> -<li><label><input type="radio" id="bar_1" value="P" name="beatle" /> Paul</label></li> -<li><label><input type="radio" id="bar_2" value="G" name="beatle" /> George</label></li> -<li><label><input type="radio" id="bar_3" value="R" name="beatle" /> Ringo</label></li> +<li><label for="bar_0"><input checked="checked" type="radio" id="bar_0" value="J" name="beatle" /> John</label></li> +<li><label for="bar_1"><input type="radio" id="bar_1" value="P" name="beatle" /> Paul</label></li> +<li><label for="bar_2"><input type="radio" id="bar_2" value="G" name="beatle" /> George</label></li> +<li><label for="bar_3"><input type="radio" id="bar_3" value="R" name="beatle" /> Ringo</label></li> </ul> # CheckboxSelectMultiple Widget ############################################### |
