Fixed #20618 -- Fixed regression in BoundField.label_tag.

This commit is contained in:
Baptiste Mispelon 2013-06-18 17:49:45 +02:00
parent ee77d4b253
commit 3128f3d38d
2 changed files with 9 additions and 3 deletions

View file

@ -1863,3 +1863,10 @@ class FormsTestCase(TestCase):
form = SomeForm()
self.assertHTMLEqual(form['custom'].label_tag(), '<label for="custom_id_custom">Custom:</label>')
self.assertHTMLEqual(form['empty'].label_tag(), '<label>Empty:</label>')
def test_boundfield_empty_label(self):
class SomeForm(Form):
field = CharField(label='')
boundfield = SomeForm()['field']
self.assertHTMLEqual(boundfield.label_tag(), '<label for="id_field"></label>')