diff --git a/crispy_forms_bootstrap2/templates/bootstrap/accordion-group.html b/crispy_forms_bootstrap2/templates/bootstrap/accordion-group.html index 2a42618..e77e64d 100644 --- a/crispy_forms_bootstrap2/templates/bootstrap/accordion-group.html +++ b/crispy_forms_bootstrap2/templates/bootstrap/accordion-group.html @@ -1,4 +1,4 @@ -
+
diff --git a/crispy_forms_bootstrap2/templates/bootstrap/accordion.html b/crispy_forms_bootstrap2/templates/bootstrap/accordion.html index 9a589e5..a934cf7 100644 --- a/crispy_forms_bootstrap2/templates/bootstrap/accordion.html +++ b/crispy_forms_bootstrap2/templates/bootstrap/accordion.html @@ -1,3 +1,3 @@ -
+
{{ content|safe }}
diff --git a/requirements.txt b/requirements.txt index 66411d7..b0b704d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ pytest pytest-cov pytest-django django -django-crispy-forms +django-crispy-forms>=2.3 diff --git a/setup.py b/setup.py index 45991e4..af7cfa2 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ url="https://github.com/django-crispy-forms/crispy-forms-bootstrap2", license="MIT", description="Django-crispy-forms bootstrap2 templates", - install_requires=["django-crispy-forms >= 1.8"], + install_requires=["django-crispy-forms >= 2.3"], classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", diff --git a/tests/test_layout_objects.py b/tests/test_layout_objects.py index 79a045f..9b03a8c 100644 --- a/tests/test_layout_objects.py +++ b/tests/test_layout_objects.py @@ -283,6 +283,39 @@ def test_accordion_and_accordiongroup(self, settings): assert html.count('name="password1"') == 1 assert html.count('name="password2"') == 1 + def test_accordion_css_class_is_applied(self): + classes = "one two three" + test_form = SampleForm() + test_form.helper = FormHelper() + test_form.helper.form_tag = False + test_form.helper.layout = Layout( + Accordion( + AccordionGroup("one", "first_name"), + css_class=classes, + css_id="super-accordion", + ) + ) + html = render_crispy_form(test_form) + + assert ( + html.count('