From 56b8914eb968ad49d3a15a98cec65fec849e1227 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 24 Apr 2007 12:53:29 +0000 Subject: Fixed #3870, Refs #3787 -- Fixed handling of widget attributes on RadioSelect and MultiWidget. In particular, handling of the id attribute has been fixed. Thanks to Gary Wilson and Max Derkachev. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5065 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/forms/tests.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'tests/regressiontests/forms') diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py index 4521d17d7f..8f8b3c828a 100644 --- a/tests/regressiontests/forms/tests.py +++ b/tests/regressiontests/forms/tests.py @@ -658,10 +658,31 @@ Traceback (most recent call last): ... IndexError: list index out of range +# Unicode choices are correctly rendered as HTML >>> w = RadioSelect() >>> unicode(w.render('email', 'ŠĐĆŽćžšđ', choices=[('ŠĐĆŽćžšđ', 'ŠĐabcĆŽćžšđ'), ('ćžšđ', 'abcćžšđ')])) u'' +# Attributes provided at instantiation are passed to the constituent inputs +>>> w = RadioSelect(attrs={'id':'foo'}) +>>> print w.render('beatle', 'J', choices=(('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo'))) + + +# 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'}) + + # CheckboxSelectMultiple Widget ############################################### >>> w = CheckboxSelectMultiple() @@ -783,6 +804,11 @@ u'