diff --git a/django/newforms/widgets.py b/django/newforms/widgets.py
index ebbf2ab..5a830e3 100644
--- a/django/newforms/widgets.py
+++ b/django/newforms/widgets.py
@@ -321,8 +321,8 @@ class RadioFieldRenderer(StrAndUnicode):
def render(self):
"""Outputs a
for this set of radio fields."""
- return mark_safe(u'
\n%s\n
' % u'\n'.join([u'
%s
'
- % force_unicode(w) for w in self]))
+ return mark_safe(u'
\n%s\n
' % (flatatt(self.attrs), u'\n'.join([u'
%s
'
+ % force_unicode(w) for w in self])))
class RadioSelect(Select):
renderer = RadioFieldRenderer
@@ -360,7 +360,7 @@ class CheckboxSelectMultiple(SelectMultiple):
if value is None: value = []
has_id = attrs and 'id' in attrs
final_attrs = self.build_attrs(attrs, name=name)
- output = [u'
']
+ output = [u'
' % flatatt(self.build_attrs(attrs))]
# Normalize to strings
str_values = set([force_unicode(v) for v in value])
for i, (option_value, option_label) in enumerate(chain(self.choices, choices)):
diff --git a/tests/regressiontests/forms/forms.py b/tests/regressiontests/forms/forms.py
index 7fc206d..1ef290f 100644
--- a/tests/regressiontests/forms/forms.py
+++ b/tests/regressiontests/forms/forms.py
@@ -442,7 +442,7 @@ gets a distinct ID, formed by appending an underscore plus the button's
zero-based index.
>>> f = FrameworkForm(auto_id='id_%s')
>>> print f['language']
-
+
@@ -452,19 +452,19 @@ either as_table() or as_ul(), the label for the RadioSelect will point to the
ID of the *first* radio button.
>>> print f
-
+
>>> print f.as_ul()
-
+
>>> print f.as_p()
-
+
@@ -534,7 +534,7 @@ gets a distinct ID, formed by appending an underscore plus the checkbox's
zero-based index.
>>> f = SongForm(auto_id='%s_id')
>>> print f['composers']
-
'
Testing choice validation with UTF-8 bytestrings as input (these are the
Russian abbreviations "мес." and "шт.".
@@ -56,7 +56,7 @@ Translated error messages used to be buggy.
>>> activate('ru')
>>> f = SomeForm({})
>>> f.as_p()
-u'