Test that labels do not print when label = False
@@ -133,6 +133,17 @@ def test_i18n():
assert "Introduzca un valor correcto" in html
deactivate()
+def test_remove_labels():
+ form = SampleForm()
+ #remove boolean field as label is still printed in boostrap
+ del form.fields['is_company']
+
+ for fields in form:
+ fields.label = False
+
+ html = render_crispy_form(form)
+
+ assert '<label' not in html
@only_bootstrap
class TestBootstrapLayoutObjects(object):
