Repository: zostera/django-bootstrap3

Issue:
#453 actually breaks checkboxes
Image of form with checkbox:

https://drive.google.com/open?id=1nNlAnZbnhMLbnzRh4xvrBFL6YG40YD30

template code:


```
        <form class="login form form-horizontal" method="POST" action="{% url 'account_login' %}">
            {% csrf_token %}
            {% bootstrap_form form layout="horizontal" horizontal_field_class="col-sm-6" horizontal_label_class="col-sm-3" %}

            {% if redirect_field_value %}
            <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
            {% endif %}

            <div class="pull-right">
                <button class="primaryAction btn btn-primary" type="submit">
                    {% trans "Sign In" %}
                </button>
            </div>
        </form>
```

#453 actually breaks checkboxes
Image of form with checkbox:

https://drive.google.com/open?id=1nNlAnZbnhMLbnzRh4xvrBFL6YG40YD30

template code:


```
        <form class="login form form-horizontal" method="POST" action="{% url 'account_login' %}">
            {% csrf_token %}
            {% bootstrap_form form layout="horizontal" horizontal_field_class="col-sm-6" horizontal_label_class="col-sm-3" %}

            {% if redirect_field_value %}
            <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
            {% endif %}

            <div class="pull-right">
                <button class="primaryAction btn btn-primary" type="submit">
                    {% trans "Sign In" %}
                </button>
            </div>
        </form>
```



Discussion:
Put label class in checkbox as the same class as the label for other field is not a good idea especially for horizontal forms. Please roll it back or add a new variable to allow user to customize it. 
Put label class in checkbox as the same class as the label for other field is not a good idea especially for horizontal forms. Please roll it back or add a new variable to allow user to customize it. 

Resolving patch:
diff --git a/src/bootstrap3/renderers.py b/src/bootstrap3/renderers.py
--- a/src/bootstrap3/renderers.py
+++ b/src/bootstrap3/renderers.py
@@ -327,7 +327,6 @@ def put_inside_label(self, html):
             content=mark_safe(content),
             label_for=self.field.id_for_label,
             label_title=escape(strip_tags(self.field_help)),
-            label_class=self.get_label_class(),
         )
 
     def fix_date_select_input(self, html):


Test patch:
diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py
--- a/tests/test_templatetags.py
+++ b/tests/test_templatetags.py
@@ -151,6 +151,22 @@ def test_illegal_field(self):
         with self.assertRaises(BootstrapError):
             render_field(field="illegal")
 
+    def test_checkbox(self):
+        res = render_form_field("cc_myself")
+        self.assertHTMLEqual(
+            """
+<div class="form-group">
+    <div class="checkbox">
+        <label for="id_cc_myself" title="cc stands for &quot;carbon copy.&quot; You will get a copy in your mailbox.">
+        <input type="checkbox" name="cc_myself" class="" id="id_cc_myself"> Cc myself
+        </label>
+    </div>
+    <div class="help-block">cc stands for "carbon copy." You will get a copy in your mailbox.</div>
+</div>
+        """,
+            res,
+        )
+
     def test_show_help(self):
         res = render_form_field("subject")
         self.assertIn("my_help_text", res)
@@ -206,7 +222,9 @@ def test_input_group(self):
 
     def test_input_group_addon_button(self):
         res = render_template_with_form(
-            '{% bootstrap_field form.subject addon_before="$" addon_before_class="input-group-btn" addon_after=".00" addon_after_class="input-group-btn" %}'  # noqa
+            "{% bootstrap_field form.subject "
+            'addon_before="$" addon_before_class="input-group-btn" '
+            'addon_after=".00" addon_after_class="input-group-btn" %}'
         )
         self.assertIn('class="input-group"', res)
         self.assertIn('class="input-group-btn">$', res)