From 584bd14dcfdee9585fec7794d53ce120ea73d0bc Mon Sep 17 00:00:00 2001 From: Gabe Jackson Date: Fri, 8 Jun 2012 15:32:35 +0200 Subject: Fixed #18134 -- BoundField.label_tag now includes the form's label_suffix There was an inconsistency between how the label_tag for forms were generated depending on which method was used: as_p, as_ul and as_table contained code to append the label_suffix where as label_tag called on a form field directly did NOT append the label_suffix. The code for appending the label_suffix has been moved in to the label_tag code of the field and the HTML generation code for as_p, as_ul and as_table now calls this code as well. This is a backwards incompatible change because users who have added the label_suffix manually in their templates may now get double label_suffix characters in their forms. --- tests/admin_util/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/admin_util') diff --git a/tests/admin_util/tests.py b/tests/admin_util/tests.py index 4a9a203f50..637f643261 100644 --- a/tests/admin_util/tests.py +++ b/tests/admin_util/tests.py @@ -301,7 +301,7 @@ class UtilTests(SimpleTestCase): self.assertHTMLEqual(helpers.AdminField(form, 'text', is_first=False).label_tag(), '') self.assertHTMLEqual(helpers.AdminField(form, 'cb', is_first=False).label_tag(), - '') + '') # normal strings needs to be escaped class MyForm(forms.Form): @@ -312,7 +312,7 @@ class UtilTests(SimpleTestCase): self.assertHTMLEqual(helpers.AdminField(form, 'text', is_first=False).label_tag(), '') self.assertHTMLEqual(helpers.AdminField(form, 'cb', is_first=False).label_tag(), - '') + '') def test_flatten_fieldsets(self): """ -- cgit v1.3