From c8c9dbfc63b761a732d85e1ce87539f3e65e660d Mon Sep 17 00:00:00 2001 From: David Smith Date: Thu, 9 Apr 2020 20:19:08 +0100 Subject: [PATCH] Completed test coverage for BoundField.css_classes(). --- tests/forms_tests/tests/test_forms.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py index f56eaee4b0..16ecf09814 100644 --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -3151,6 +3151,14 @@ Good luck picking a username that doesn't already exist.

self.assertEqual(f['first_name'].widget_type, 'text') self.assertEqual(f['birthday'].widget_type, 'splithiddendatetime') + def test_boundfield_css_classes(self): + form = Person() + field = form['first_name'] + self.assertEqual(field.css_classes(), '') + self.assertEqual(field.css_classes(extra_classes=''), '') + self.assertEqual(field.css_classes(extra_classes='test'), 'test') + self.assertEqual(field.css_classes(extra_classes='test test'), 'test') + def test_label_tag_override(self): """ BoundField label_suffix (if provided) overrides Form label_suffix