diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py
index 056dbad296..690f205680 100644
--- a/tests/forms_tests/tests/test_forms.py
+++ b/tests/forms_tests/tests/test_forms.py
@@ -446,6 +446,13 @@ class FormsTestCase(SimpleTestCase):
""")
+ # Test iterating on individual radios in a template
+ t = Template('{% for radio in form.language %}
{{ radio }}
{% endfor %}')
+ self.assertHTMLEqual(t.render(Context({'form': f})), """
+""")
+
def test_form_with_iterable_boundfield(self):
class BeatleForm(Form):
name = ChoiceField(choices=[('john', 'John'), ('paul', 'Paul'), ('george', 'George'), ('ringo', 'Ringo')], widget=RadioSelect)
@@ -538,6 +545,12 @@ class FormsTestCase(SimpleTestCase):
""")
+ # Test iterating on individual checkboxes in a template
+ t = Template('{% for checkbox in form.composers %}
{{ checkbox }}
{% endfor %}')
+ self.assertHTMLEqual(t.render(Context({'form': f})), """
+""")
def test_checkbox_auto_id(self):
# Regarding auto_id, CheckboxSelectMultiple is a special case. Each checkbox