diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2ead542..f31b88a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,8 +12,6 @@ jobs: strategy: matrix: python-version: - - '3.8' - - '3.9' - '3.10' - '3.11' - '3.12' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1021225..76b0755 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,8 +14,6 @@ jobs: strategy: matrix: python-version: - - '3.8' - - '3.9' - '3.10' - '3.11' - '3.12' diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c01948..641a9ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG FOR CRISPY-BOOTSTRAP4 +## Next Release (TBC) +* Removed support for Django 4.2, 5.0 and 5.1. + ## 2025.6 (2025-06-08) * Added support for Python 3.13. diff --git a/crispy_bootstrap4/templates/bootstrap4/layout/field_errors.html b/crispy_bootstrap4/templates/bootstrap4/layout/field_errors.html index b2d4dae..60fd3da 100644 --- a/crispy_bootstrap4/templates/bootstrap4/layout/field_errors.html +++ b/crispy_bootstrap4/templates/bootstrap4/layout/field_errors.html @@ -1,10 +1,5 @@ {% if form_show_errors and field.errors %} - {% if field.errors.field_id %} - {# Django 5.2+ #} -
- {% else %} -
- {% endif %} +
{% for error in field.errors %} {{ error }} {% endfor %} diff --git a/crispy_bootstrap4/templates/bootstrap4/layout/field_errors_block.html b/crispy_bootstrap4/templates/bootstrap4/layout/field_errors_block.html index 0c32aef..ad500bb 100644 --- a/crispy_bootstrap4/templates/bootstrap4/layout/field_errors_block.html +++ b/crispy_bootstrap4/templates/bootstrap4/layout/field_errors_block.html @@ -1,10 +1,5 @@ {% if form_show_errors and field.errors %} - {% if field.errors.field_id %} - {# Django 5.2+ #} -
- {% else %} -
- {% endif %} +
{% for error in field.errors %}

{{ error }}

{% endfor %} diff --git a/pyproject.toml b/pyproject.toml index fd21dbb..660cbb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,15 +15,13 @@ classifiers=[ "Environment :: Web Environment", "Development Status :: 5 - Production/Stable", "Framework :: Django", - "Framework :: Django :: 4.2", - "Framework :: Django :: 5.0", - "Framework :: Django :: 5.1", "Framework :: Django :: 5.2", + + + "Operating System :: OS Independent", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", diff --git a/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false_lt50.html b/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false_lt50.html deleted file mode 100644 index c01b99c..0000000 --- a/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false_lt50.html +++ /dev/null @@ -1,69 +0,0 @@ -
-
- -
-
- -
whatever
-
- Insert your email -
-
-
- -
-
-
blabla
- -
-
-
-
- -
-
-
foo
- -
bar
-
-
-
-
- -
-
- -
whatever
-
-
-
-
- -
-
-
blabla
- -
-
-
-
diff --git a/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false_lt52.html b/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false_lt52.html deleted file mode 100644 index 9bd16d5..0000000 --- a/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false_lt52.html +++ /dev/null @@ -1,72 +0,0 @@ -
-
- -
-
- -
whatever
-
- Insert your email -
-
-
- -
-
-
blabla
- -
-
-
-
- -
-
-
foo
- -
bar
-
-
-
-
- -
-
- -
whatever
-
-
-
-
- -
-
-
blabla
- -
-
-
-
diff --git a/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true_lt50.html b/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true_lt50.html deleted file mode 100644 index 7e3724f..0000000 --- a/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true_lt50.html +++ /dev/null @@ -1,74 +0,0 @@ -
-
- -
-
- -
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
- -
-
-
-
\ No newline at end of file diff --git a/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true_lt52.html b/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true_lt52.html deleted file mode 100644 index 49e4d71..0000000 --- a/tests/results/bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true_lt52.html +++ /dev/null @@ -1,77 +0,0 @@ -
-
- -
-
- -
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
- -
-
-
-
\ No newline at end of file diff --git a/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_false_lt50.html b/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_false_lt50.html deleted file mode 100644 index bbc43a2..0000000 --- a/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_false_lt50.html +++ /dev/null @@ -1,39 +0,0 @@ -
-
-
-
-
-
Insert your email
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
\ No newline at end of file diff --git a/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_false_lt52.html b/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_false_lt52.html deleted file mode 100644 index ea6d23c..0000000 --- a/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_false_lt52.html +++ /dev/null @@ -1,40 +0,0 @@ -
-
-
-
-
-
Insert your email
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
\ No newline at end of file diff --git a/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_true_lt50.html b/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_true_lt50.html deleted file mode 100644 index 18ddc6d..0000000 --- a/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_true_lt50.html +++ /dev/null @@ -1,59 +0,0 @@ -
-
-
    -
  • 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 --git a/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_true_lt52.html b/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_true_lt52.html deleted file mode 100644 index f002fdb..0000000 --- a/tests/results/bootstrap4/test_form_helper/test_form_show_errors_non_field_errors_true_lt52.html +++ /dev/null @@ -1,59 +0,0 @@ -
-
-
    -
  • 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 --git a/tests/results/bootstrap4/test_layout/test_use_custom_control_is_used_in_checkboxes_true_failing_lt50.html b/tests/results/bootstrap4/test_layout/test_use_custom_control_is_used_in_checkboxes_true_failing_lt50.html deleted file mode 100644 index 3911244..0000000 --- a/tests/results/bootstrap4/test_layout/test_use_custom_control_is_used_in_checkboxes_true_failing_lt50.html +++ /dev/null @@ -1,70 +0,0 @@ -
-
-
-
-
-
-
-

- This field is required. -

-
-
-
-
-
-
-
-
-
-
-
-
- -
-

- This field is required. -

-
-
-
-
-
-
-
-
-
-
-

- This field is required. -

-
-
-
-
-
diff --git a/tests/results/bootstrap4/test_layout/test_use_custom_control_is_used_in_radio_true_failing_lt50.html b/tests/results/bootstrap4/test_layout/test_use_custom_control_is_used_in_radio_true_failing_lt50.html deleted file mode 100644 index c1802c9..0000000 --- a/tests/results/bootstrap4/test_layout/test_use_custom_control_is_used_in_radio_true_failing_lt50.html +++ /dev/null @@ -1,22 +0,0 @@ -
-
-
-
-
-
-
-

- This field is required. -

-
-
-
-
-
diff --git a/tests/results/bootstrap4/test_layout_objects/test_grouped_checkboxes_failing_lt50.html b/tests/results/bootstrap4/test_layout_objects/test_grouped_checkboxes_failing_lt50.html deleted file mode 100644 index 13df98a..0000000 --- a/tests/results/bootstrap4/test_layout_objects/test_grouped_checkboxes_failing_lt50.html +++ /dev/null @@ -1,36 +0,0 @@ - -
-
-
- Audio -
-
-
- Video -
-
-
-
-
-

- This field is required. -

-
-
-
-
-
diff --git a/tests/results/bootstrap4/test_layout_objects/test_grouped_radios_failing_lt50.html b/tests/results/bootstrap4/test_layout_objects/test_grouped_radios_failing_lt50.html deleted file mode 100644 index 313d17e..0000000 --- a/tests/results/bootstrap4/test_layout_objects/test_grouped_radios_failing_lt50.html +++ /dev/null @@ -1,30 +0,0 @@ -
-
-
- Audio -
-
-
- Video -
-
-
-
-
-

- This field is required. -

-
-
-
-
-
diff --git a/tests/results/bootstrap4/test_layout_objects/test_prepended_appended_text_lt50.html b/tests/results/bootstrap4/test_layout_objects/test_prepended_appended_text_lt50.html deleted file mode 100644 index d5be9da..0000000 --- a/tests/results/bootstrap4/test_layout_objects/test_prepended_appended_text_lt50.html +++ /dev/null @@ -1,32 +0,0 @@ -
-
- -
-
-
@
- -
- gmail.com -
-
Insert your email -
-
-
- -
-
- -
#
-
-
-
-
- -
-
-
$
- -
-
-
-
\ No newline at end of file diff --git a/tests/test_form_helper.py b/tests/test_form_helper.py index 05aef37..c6810e3 100644 --- a/tests/test_form_helper.py +++ b/tests/test_form_helper.py @@ -1,6 +1,5 @@ import re -import django import pytest from crispy_forms.bootstrap import ( AppendedText, @@ -38,12 +37,10 @@ def test_inputs(): form_helper.add_input(Hidden("my-hidden", "Hidden")) form_helper.add_input(Button("my-button", "Button")) - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form_helper %} - """ - ) + """) c = Context({"form": SampleForm(), "form_helper": form_helper}) html = template.render(c) @@ -72,12 +69,10 @@ def test_form_with_helper_without_layout(): form_helper.form_action = "simpleAction" form_helper.form_error_title = "ERRORS" - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy testForm form_helper %} - """ - ) + """) # now we render it, with errors form = SampleForm({"password1": "wargame", "password2": "god"}) @@ -112,52 +107,28 @@ def test_form_show_errors_non_field_errors(settings): form.helper.form_show_errors = True form.is_valid() - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy testForm %} - """ - ) + """) # First we render with errors c = Context({"testForm": form}) # Ensure those errors were rendered - if django.VERSION < (5, 0): - expected = parse_expected( - "bootstrap4/test_form_helper/" - "test_form_show_errors_non_field_errors_true_lt50.html" - ) - elif django.VERSION < (5, 2): - expected = parse_expected( - "bootstrap4/test_form_helper/" - "test_form_show_errors_non_field_errors_true_lt52.html" - ) - else: - expected = parse_expected( - "bootstrap4/test_form_helper/" - "test_form_show_errors_non_field_errors_true.html" - ) + expected = parse_expected( + "bootstrap4/test_form_helper/" + "test_form_show_errors_non_field_errors_true.html" + ) assert parse_html(template.render(c)) == expected # Now we render without errors form.helper.form_show_errors = False c = Context({"testForm": form}) # Ensure errors were not rendered - if django.VERSION < (5, 0): - expected = parse_expected( - "bootstrap4/test_form_helper/" - "test_form_show_errors_non_field_errors_false_lt50.html" - ) - elif django.VERSION < (5, 2): - expected = parse_expected( - "bootstrap4/test_form_helper/" - "test_form_show_errors_non_field_errors_false_lt52.html" - ) - else: - expected = parse_expected( - "bootstrap4/test_form_helper/" - "test_form_show_errors_non_field_errors_false.html" - ) + expected = parse_expected( + "bootstrap4/test_form_helper/" + "test_form_show_errors_non_field_errors_false.html" + ) assert parse_html(template.render(c)) == expected @@ -234,12 +205,10 @@ def test_template_helper_access(): def test_without_helper(): - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form %} - """ - ) + """) c = Context({"form": SampleForm()}) html = template.render(c) @@ -250,12 +219,10 @@ def test_without_helper(): def test_formset_with_helper_without_layout(): - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy testFormSet formset_helper %} - """ - ) + """) form_helper = FormHelper() form_helper.form_id = "thisFormsetRocks" @@ -291,12 +258,10 @@ def test_formset_with_helper_without_layout(): def test_CSRF_token_POST_form(): form_helper = FormHelper() - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form_helper %} - """ - ) + """) # The middleware only initializes the CSRF token when processing a real request # So using RequestContext or csrf(request) here does not work. @@ -317,12 +282,10 @@ def test_CSRF_token_POST_form(): def test_CSRF_token_GET_form(): form_helper = FormHelper() form_helper.form_method = "GET" - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form_helper %} - """ - ) + """) c = Context( { @@ -483,32 +446,10 @@ def test_bootstrap_form_show_errors_bs4(): ) form.is_valid() form.helper.form_show_errors = True - if django.VERSION < (5, 0): - expected = ( - "bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true_lt50.html" - ) - elif django.VERSION < (5, 2): - expected = ( - "bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true_lt52.html" - ) - else: - expected = ( - "bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true.html" - ) + expected = "bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_true.html" assert parse_form(form) == parse_expected(expected) form.helper.form_show_errors = False - if django.VERSION < (5, 0): - expected = ( - "bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false_lt50.html" - ) - elif django.VERSION < (5, 2): - expected = ( - "bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false_lt52.html" - ) - else: - expected = ( - "bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false.html" - ) + expected = "bootstrap4/test_form_helper/bootstrap_form_show_errors_bs4_false.html" assert parse_form(form) == parse_expected(expected) diff --git a/tests/test_layout.py b/tests/test_layout.py index 470918a..dd745e8 100644 --- a/tests/test_layout.py +++ b/tests/test_layout.py @@ -1,4 +1,3 @@ -import django import pytest from crispy_forms import __version__ from crispy_forms.bootstrap import Field, InlineCheckboxes, UneditableField @@ -44,12 +43,10 @@ def test_invalid_unicode_characters(settings): form_helper = FormHelper() form_helper.add_layout(Layout("espaƱa")) - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form_helper %} - """ - ) + """) c = Context({"form": SampleForm(), "form_helper": form_helper}) settings.CRISPY_FAIL_SILENTLY = False with pytest.raises(Exception): @@ -81,12 +78,10 @@ class Meta: form_helper = FormHelper() form_helper.layout = Layout("first_name") - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form_helper %} - """ - ) + """) c = Context({"form": form, "form_helper": form_helper}) html = template.render(c) assert "email" not in html @@ -96,12 +91,10 @@ def test_layout_unresolved_field(settings): form_helper = FormHelper() form_helper.add_layout(Layout("typo")) - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form_helper %} - """ - ) + """) c = Context({"form": SampleForm(), "form_helper": form_helper}) settings.CRISPY_FAIL_SILENTLY = False with pytest.raises(Exception): @@ -112,12 +105,10 @@ def test_double_rendered_field(settings): form_helper = FormHelper() form_helper.add_layout(Layout("is_company", "is_company")) - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form_helper %} - """ - ) + """) c = Context({"form": SampleForm(), "form_helper": form_helper}) settings.CRISPY_FAIL_SILENTLY = False with pytest.raises(Exception): @@ -131,14 +122,12 @@ class ExampleForm(forms.Form): form = ExampleForm() form2 = SampleForm() - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {{ form.as_ul }} {% crispy form2 %} {{ form.as_ul }} - """ - ) + """) c = Context({"form": form, "form2": form2}) html = template.render(c) @@ -168,23 +157,19 @@ def test_layout_fieldset_row_html_with_unicode_fieldnames(): css_class="rows", ), HTML('test link'), - HTML( - """ + HTML(""" {% if flag %}{{ message }}{% endif %} - """ - ), + """), "first_name", "last_name", ), ) ) - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form_helper %} - """ - ) + """) c = Context( { "form": SampleForm(), @@ -208,12 +193,10 @@ def test_layout_fieldset_row_html_with_unicode_fieldnames(): def test_change_layout_dynamically_delete_field(): - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form_helper %} - """ - ) + """) form = SampleForm() form_helper = FormHelper() @@ -246,12 +229,10 @@ def test_change_layout_dynamically_delete_field(): def test_column_has_css_classes(): - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form_helper %} - """ - ) + """) form = SampleForm() form_helper = FormHelper() @@ -275,12 +256,10 @@ def test_column_has_css_classes(): def test_bs4_column_css_classes(): - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form_helper %} - """ - ) + """) form = SampleForm() form_helper = FormHelper() @@ -401,12 +380,10 @@ def test_modelformset_layout(): def test_i18n(): - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form form.helper %} - """ - ) + """) form = SampleForm() form_helper = FormHelper() form_helper.layout = Layout( @@ -536,16 +513,10 @@ def test_use_custom_control_is_used_in_checkboxes(): InlineCheckboxes("alphacheckboxes"), "numeric_multiple_checkboxes", ) - if django.VERSION < (5, 0): - expected = ( - "bootstrap4/test_layout/" - "test_use_custom_control_is_used_in_checkboxes_true_failing_lt50.html" - ) - else: - expected = ( - "bootstrap4/test_layout/" - "test_use_custom_control_is_used_in_checkboxes_true_failing.html" - ) + expected = ( + "bootstrap4/test_layout/" + "test_use_custom_control_is_used_in_checkboxes_true_failing.html" + ) assert parse_form(form) == parse_expected(expected) @@ -575,16 +546,10 @@ def test_use_custom_control_is_used_in_radio(): form.helper.layout = Layout( "radio_select", ) - if django.VERSION < (5, 0): - expected = ( - "bootstrap4/test_layout/" - "test_use_custom_control_is_used_in_radio_true_failing_lt50.html" - ) - else: - expected = ( - "bootstrap4/test_layout/" - "test_use_custom_control_is_used_in_radio_true_failing.html" - ) + expected = ( + "bootstrap4/test_layout/" + "test_use_custom_control_is_used_in_radio_true_failing.html" + ) assert parse_form(form) == parse_expected(expected) diff --git a/tests/test_layout_objects.py b/tests/test_layout_objects.py index 5adea3b..381cc99 100644 --- a/tests/test_layout_objects.py +++ b/tests/test_layout_objects.py @@ -1,6 +1,5 @@ import re -import django import pytest from crispy_forms import __version__ from crispy_forms.bootstrap import ( @@ -45,12 +44,10 @@ def test_multiwidget_field(): - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy form %} - """ - ) + """) test_form = SampleForm() test_form.helper = FormHelper() @@ -76,12 +73,10 @@ def test_multiwidget_field(): def test_field_type_hidden(): - template = Template( - """ + template = Template(""" {% load crispy_forms_tags %} {% crispy test_form %} - """ - ) + """) test_form = SampleForm() test_form.helper = FormHelper() @@ -158,14 +153,7 @@ def test_prepended_appended_text(self, settings): AppendedText("password1", "#", css_class="input-lg"), PrependedText("password2", "$", css_class="input-sm"), ) - if django.VERSION < (5, 0): - expected = ( - "bootstrap4/test_layout_objects/test_prepended_appended_text_lt50.html" - ) - else: - expected = ( - "bootstrap4/test_layout_objects/test_prepended_appended_text.html" - ) + expected = "bootstrap4/test_layout_objects/test_prepended_appended_text.html" assert parse_form(test_form) == parse_expected(expected) def test_prepended_wrapper_class(self): @@ -476,23 +464,10 @@ def test_grouped_checkboxes_radios(self): form = GroupedChoiceForm({}) form.helper = FormHelper() form.helper.layout = Layout("checkbox_select_multiple") - if django.VERSION < (5, 0): - expected = ( - "bootstrap4/test_layout_objects/" - "test_grouped_checkboxes_failing_lt50.html" - ) - else: - expected = ( - "bootstrap4/test_layout_objects/test_grouped_checkboxes_failing.html" - ) + expected = "bootstrap4/test_layout_objects/test_grouped_checkboxes_failing.html" assert parse_form(form) == parse_expected(expected) form.helper.layout = Layout("radio") - if django.VERSION < (5, 0): - expected = ( - "bootstrap4/test_layout_objects/test_grouped_radios_failing_lt50.html" - ) - else: - expected = "bootstrap4/test_layout_objects/test_grouped_radios_failing.html" + expected = "bootstrap4/test_layout_objects/test_grouped_radios_failing.html" assert parse_form(form) == parse_expected(expected) def test_non_ascii_chars_in_container_name(self): diff --git a/tests/test_tags.py b/tests/test_tags.py index 820c1fb..a8381be 100644 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -9,25 +9,21 @@ def test_crispy_field(): - template = Template( - """ + template = Template(""" {% load crispy_forms_field %} {% for field in form %} {% crispy_field field %} {% endfor %} - """ - ) + """) html = template.render(Context({"form": SampleForm()})) assert html.count("=4.2,<5.0 - django50: django>=5.0,<5.1 - django51: django>=5.1,<5.2 django52: django>=5.2a1,<6.0 crispy2: django-crispy-forms>=2.3 crispy-latest: https://github.com/django-crispy-forms/django-crispy-forms/archive/main.tar.gz