diff -Nru python-crispy-bootstrap3-2022.1/.github/workflows/publish.yml python-crispy-bootstrap3-2024.1/.github/workflows/publish.yml --- python-crispy-bootstrap3-2022.1/.github/workflows/publish.yml 2022-12-23 17:25:13.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/.github/workflows/publish.yml 2024-01-13 09:02:24.000000000 +0000 @@ -12,7 +12,6 @@ strategy: matrix: python-version: - - '3.7' - '3.8' - '3.9' - '3.10' diff -Nru python-crispy-bootstrap3-2022.1/.github/workflows/test.yml python-crispy-bootstrap3-2024.1/.github/workflows/test.yml --- python-crispy-bootstrap3-2022.1/.github/workflows/test.yml 2022-12-23 17:25:13.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/.github/workflows/test.yml 2024-01-13 09:02:24.000000000 +0000 @@ -14,7 +14,6 @@ strategy: matrix: python-version: - - '3.7' - '3.8' - '3.9' - '3.10' diff -Nru python-crispy-bootstrap3-2022.1/CHANGELOG.md python-crispy-bootstrap3-2024.1/CHANGELOG.md --- python-crispy-bootstrap3-2022.1/CHANGELOG.md 2022-12-23 17:25:13.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/CHANGELOG.md 2024-01-13 09:02:24.000000000 +0000 @@ -1,5 +1,12 @@ # CHANGELOG FOR CRISPY-BOOTSTRAP3 +## 2024.1 + +* Updated supported versions: + * Django 3.2, 4.2 and 5.0. + * Python 3.8+. +* Fixed form-control class issue with checkboxes. + ## 2022.1 * Initial release to move the template pack from core crispy-forms to a diff -Nru python-crispy-bootstrap3-2022.1/crispy_bootstrap3/__init__.py python-crispy-bootstrap3-2024.1/crispy_bootstrap3/__init__.py --- python-crispy-bootstrap3-2022.1/crispy_bootstrap3/__init__.py 2022-12-23 17:25:13.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/crispy_bootstrap3/__init__.py 2024-01-13 09:02:24.000000000 +0000 @@ -1 +1 @@ -__version__ = "2022.1" +__version__ = "2024.1" diff -Nru python-crispy-bootstrap3-2022.1/crispy_bootstrap3/templates/bootstrap3/field.html python-crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/field.html --- python-crispy-bootstrap3-2022.1/crispy_bootstrap3/templates/bootstrap3/field.html 2022-12-23 17:25:13.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/crispy_bootstrap3/templates/bootstrap3/field.html 2024-01-13 09:02:24.000000000 +0000 @@ -25,11 +25,15 @@ {% endif %} {% if not field|is_checkboxselectmultiple and not field|is_radioselect %} - {% if field|is_checkbox and form_show_labels %} - + {% endif %} {% include 'bootstrap3/layout/help_text_and_errors.html' %} {% else %}
diff -Nru python-crispy-bootstrap3-2022.1/debian/changelog python-crispy-bootstrap3-2024.1/debian/changelog --- python-crispy-bootstrap3-2022.1/debian/changelog 2023-11-20 20:02:26.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/debian/changelog 2024-01-24 07:35:03.000000000 +0000 @@ -1,3 +1,11 @@ +python-crispy-bootstrap3 (2024.1-1) unstable; urgency=medium + + * Team upload + * New upstream version 2024.1 + * Testsuite: autopkgtest-pkg-pybuild instead of debian/tests + + -- Jérémy Lal Wed, 24 Jan 2024 08:35:03 +0100 + python-crispy-bootstrap3 (2022.1-1) unstable; urgency=low * Initial release (Closes: #1056326). diff -Nru python-crispy-bootstrap3-2022.1/debian/control python-crispy-bootstrap3-2024.1/debian/control --- python-crispy-bootstrap3-2022.1/debian/control 2023-11-20 20:02:26.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/debian/control 2024-01-24 07:30:12.000000000 +0000 @@ -19,6 +19,7 @@ Vcs-Browser: https://salsa.debian.org/python-team/packages/python-crispy-bootstrap3 Vcs-Git: https://salsa.debian.org/python-team/packages/python-crispy-bootstrap3.git Rules-Requires-Root: no +Testsuite: autopkgtest-pkg-pybuild Package: python3-crispy-bootstrap3 Architecture: all diff -Nru python-crispy-bootstrap3-2022.1/debian/tests/control python-crispy-bootstrap3-2024.1/debian/tests/control --- python-crispy-bootstrap3-2022.1/debian/tests/control 2023-11-20 20:02:26.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -Tests: upstream -Depends: - python3-all, - @, - @builddeps@, -Restrictions: allow-stderr diff -Nru python-crispy-bootstrap3-2022.1/debian/tests/upstream python-crispy-bootstrap3-2024.1/debian/tests/upstream --- python-crispy-bootstrap3-2022.1/debian/tests/upstream 2023-11-20 20:02:26.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/debian/tests/upstream 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#!/bin/sh - -set -e - -cp -r pyproject.toml tests ${AUTOPKGTEST_TMP} -cd ${AUTOPKGTEST_TMP} -for p in $(py3versions -s); do - $p -m pytest -done diff -Nru python-crispy-bootstrap3-2022.1/tests/forms.py python-crispy-bootstrap3-2024.1/tests/forms.py --- python-crispy-bootstrap3-2022.1/tests/forms.py 2022-12-23 17:25:13.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/tests/forms.py 2024-01-13 09:02:24.000000000 +0000 @@ -82,6 +82,12 @@ ) +class SimpleCheckboxSampleForm(forms.Form): + is_company = forms.CharField( + label="company", required=False, widget=forms.CheckboxInput() + ) + + class SelectSampleForm(forms.Form): select = forms.ChoiceField( choices=((1, "Option one"), (2, "Option two"), (3, "Option three")), diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false_gte50.html --- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false_gte50.html 1970-01-01 00:00:00.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false_gte50.html 2024-01-13 09:02:24.000000000 +0000 @@ -0,0 +1,45 @@ +
+
+ +
+
+ whatever
+
Insert your email
+
+
+
+ +
+
+ blabla + +
+
+
+
+ +
+
+ foo + + bar +
+
+
+
+ +
+
whatever
+
+
+
+ +
+
blabla
+
+
+
diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true_gte50.html --- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true_gte50.html 1970-01-01 00:00:00.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true_gte50.html 2024-01-13 09:02:24.000000000 +0000 @@ -0,0 +1,49 @@ +
+
+ +
+
+ whatever
+ Enter a valid email address. +
Insert your email
+
+
+
+ +
+
+ blabla + +
+ + Ensure this value has at most 5 characters (it has 19). +
+
+
+ +
+
+ foo + + bar +
+ Ensure this value has at most 5 characters (it has 18). +
+
+
+ +
+
whatever
+
+
+
+ +
+
blabla
+
+
+
diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_false_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_false_gte50.html --- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_false_gte50.html 1970-01-01 00:00:00.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_false_gte50.html 2024-01-13 09:02:24.000000000 +0000 @@ -0,0 +1,40 @@ +
+
+
+
+
+
+
Insert your email
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
\ No newline at end of file diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_true_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_true_gte50.html --- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_true_gte50.html 1970-01-01 00:00:00.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_form_helper/test_form_show_errors_non_field_errors_true_gte50.html 2024-01-13 09:02:24.000000000 +0000 @@ -0,0 +1,49 @@ +
+
+
    +
  • Passwords dont match
  • +
+
+
+
+
+
+
This field is required. +
Insert your email
+
+
+
+
+
+
+
+
+
+
This field is required.
+
+
+
This field is required.
+
+
+ +
This field is + required.
+
+
\ No newline at end of file diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout/test_layout_composition_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_layout_composition_gte50.html --- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout/test_layout_composition_gte50.html 1970-01-01 00:00:00.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_layout_composition_gte50.html 2024-01-13 09:02:24.000000000 +0000 @@ -0,0 +1,35 @@ +
+
+ +

Some company data

+
+
+
+ Insert your email
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout/test_second_layout_multifield_column_buttonholder_submit_div_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_second_layout_multifield_column_buttonholder_submit_div_gte50.html --- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout/test_second_layout_multifield_column_buttonholder_submit_div_gte50.html 1970-01-01 00:00:00.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout/test_second_layout_multifield_column_buttonholder_submit_div_gte50.html 2024-01-13 09:02:24.000000000 +0000 @@ -0,0 +1,41 @@ +
+
+ +

Some company data

+
+
+
+ Insert your email
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff -Nru python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout_objects/test_prepended_appended_text_gte50.html python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout_objects/test_prepended_appended_text_gte50.html --- python-crispy-bootstrap3-2022.1/tests/results/bootstrap3/test_layout_objects/test_prepended_appended_text_gte50.html 1970-01-01 00:00:00.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/tests/results/bootstrap3/test_layout_objects/test_prepended_appended_text_gte50.html 2024-01-13 09:02:24.000000000 +0000 @@ -0,0 +1,37 @@ +
+
+ +
+
+ @ + + gmail.com +
+
Insert your email
+
+
+
+ +
+
+ + # +
+
+
+
+ +
+
+ $ + +
+
+
+
\ No newline at end of file diff -Nru python-crispy-bootstrap3-2022.1/tests/test_form_helper.py python-crispy-bootstrap3-2024.1/tests/test_form_helper.py --- python-crispy-bootstrap3-2022.1/tests/test_form_helper.py 2022-12-23 17:25:13.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/tests/test_form_helper.py 2024-01-13 09:02:24.000000000 +0000 @@ -139,6 +139,13 @@ "bootstrap3/test_form_helper/" "test_form_show_errors_non_field_errors_true_lte40.html" ) + elif django.VERSION >= (5, 0): + # Added 'aria-describedby' for fields with help_text + # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms + expected = parse_expected( + "bootstrap3/test_form_helper/" + "test_form_show_errors_non_field_errors_true_gte50.html" + ) else: expected = parse_expected( "bootstrap3/test_form_helper/" @@ -155,6 +162,13 @@ "bootstrap3/test_form_helper/" "test_form_show_errors_non_field_errors_false_lte40.html" ) + elif django.VERSION >= (5, 0): + # Added 'aria-describedby' for fields with help_text + # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms + expected = parse_expected( + "bootstrap3/test_form_helper/" + "test_form_show_errors_non_field_errors_false_gte50.html" + ) else: expected = parse_expected( "bootstrap3/test_form_helper/" @@ -528,14 +542,31 @@ form.is_valid() form.helper.form_show_errors = True - assert parse_form(form) == parse_expected( - "bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true.html" - ) + if django.VERSION >= (5, 0): + # Added 'aria-describedby' for fields with help_text + # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms + expected = parse_expected( + "bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true_gte50.html" + ) + else: + expected = parse_expected( + "bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_true.html" + ) + assert parse_form(form) == expected form.helper.form_show_errors = False - assert parse_form(form) == parse_expected( - "bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false.html" - ) + if django.VERSION >= (5, 0): + # Added 'aria-describedby' for fields with help_text + # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms + expected = parse_expected( + "bootstrap3/test_form_helper/" + "bootstrap_form_show_errors_bs3_false_gte50.html" + ) + else: + expected = parse_expected( + "bootstrap3/test_form_helper/bootstrap_form_show_errors_bs3_false.html" + ) + assert parse_form(form) == expected def test_error_text_inline(settings): diff -Nru python-crispy-bootstrap3-2022.1/tests/test_layout.py python-crispy-bootstrap3-2024.1/tests/test_layout.py --- python-crispy-bootstrap3-2022.1/tests/test_layout.py 2022-12-23 17:25:13.000000000 +0000 +++ python-crispy-bootstrap3-2024.1/tests/test_layout.py 2024-01-13 09:02:24.000000000 +0000 @@ -1,3 +1,4 @@ +import django import pytest from crispy_forms import __version__ from crispy_forms.bootstrap import Field, InlineCheckboxes @@ -34,6 +35,7 @@ SampleForm4, SampleForm5, SampleForm6, + SimpleCheckboxSampleForm, ) from .test_settings import TEMPLATE_DIRS from .utils import contains_partial, parse_expected, parse_form @@ -462,9 +464,15 @@ html = template.render(c) # Bootstrap 4 does not contain a multifield template - assert parse_html(html) == parse_expected( - "bootstrap3/test_layout/test_layout_composition.html" - ) + if django.VERSION >= (5, 0): + # Added 'aria-describedby' for fields with help_text + # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms + expected = parse_expected( + "bootstrap3/test_layout/test_layout_composition_gte50.html" + ) + else: + expected = parse_expected("bootstrap3/test_layout/test_layout_composition.html") + assert parse_html(html) == expected @override_settings(CRISPY_CLASS_CONVERTERS=CONVERTERS) @@ -516,10 +524,19 @@ html = template.render(c) # Bootstrap 4 does not contain a multifield template - assert parse_html(html) == parse_expected( - "bootstrap3/test_layout/" - "test_second_layout_multifield_column_buttonholder_submit_div.html" - ) + if django.VERSION >= (5, 0): + # Added 'aria-describedby' for fields with help_text + # https://docs.djangoproject.com/en/5.0/releases/5.0/#forms + expected = parse_expected( + "bootstrap3/test_layout/" + "test_second_layout_multifield_column_buttonholder_submit_div_gte50.html" + ) + else: + expected = parse_expected( + "bootstrap3/test_layout/" + "test_second_layout_multifield_column_buttonholder_submit_div.html" + ) + assert parse_html(html) == expected @override_settings( @@ -570,6 +587,19 @@ ) +def test_no_label_checkboxes_bs3(): + form = SimpleCheckboxSampleForm() + form.helper = FormHelper() + # no form-control class when labels are rendered + html = render_crispy_form(form) + assert html.count("form-control") == 0 + form.helper.form_show_labels = False + # no labels or form-control class when labels are hidden + html = render_crispy_form(form) + assert html.count("