From d1c7a5ee1326b733f30738d80acb59c01f3d411e Mon Sep 17 00:00:00 2001 From: David Smith Date: Sat, 21 Oct 2023 15:54:04 +0100 Subject: [PATCH] Added Django 5.0 support and Dropped Django 3.2 and 4.1. --- CHANGELOG.md | 6 +- .../bootstrap5/layout/help_text.html | 4 +- pyproject.toml | 6 +- tests/results/field_with_buttons.html | 9 +- tests/results/field_with_buttons_failing.html | 2 +- .../field_with_buttons_failing_lt50.html | 14 +++ tests/results/field_with_buttons_lt50.html | 14 +++ tests/results/help_text_escape.html | 4 +- tests/results/help_text_escape_lt50.html | 5 + .../results/test_bootstrap5_form_inline.html | 2 +- .../test_bootstrap5_form_inline_lt50.html | 20 ++++ .../test_clearable_file_field_failing.html | 9 +- ...est_clearable_file_field_failing_lt50.html | 14 +++ tests/results/test_file_field_failing.html | 9 +- .../results/test_file_field_failing_lt50.html | 14 +++ .../results/test_floating_field_failing.html | 4 +- .../test_floating_field_failing_lt50.html | 25 +++++ tests/results/test_grouped_checkboxes.html | 2 +- .../test_grouped_checkboxes_failing.html | 12 +- .../test_grouped_checkboxes_failing_lt50.html | 28 +++++ .../results/test_grouped_radios_failing.html | 10 +- .../test_grouped_radios_failing_lt50.html | 25 +++++ .../results/test_prepended_appended_text.html | 4 +- .../test_prepended_appended_text_lt50.html | 26 +++++ .../results/test_tabular_formset_layout.html | 14 ++- .../test_tabular_formset_layout_failing.html | 22 ++-- ...t_tabular_formset_layout_failing_lt50.html | 87 +++++++++++++++ .../test_tabular_formset_layout_lt50.html | 103 ++++++++++++++++++ tests/test_form_helper.py | 4 +- tests/test_layout.py | 52 +++++++-- tests/test_layout_objects.py | 30 +++-- tox.ini | 10 +- 32 files changed, 514 insertions(+), 76 deletions(-) create mode 100644 tests/results/field_with_buttons_failing_lt50.html create mode 100644 tests/results/field_with_buttons_lt50.html create mode 100644 tests/results/help_text_escape_lt50.html create mode 100644 tests/results/test_bootstrap5_form_inline_lt50.html create mode 100644 tests/results/test_clearable_file_field_failing_lt50.html create mode 100644 tests/results/test_file_field_failing_lt50.html create mode 100644 tests/results/test_floating_field_failing_lt50.html create mode 100644 tests/results/test_grouped_checkboxes_failing_lt50.html create mode 100644 tests/results/test_grouped_radios_failing_lt50.html create mode 100644 tests/results/test_prepended_appended_text_lt50.html create mode 100644 tests/results/test_tabular_formset_layout_failing_lt50.html create mode 100644 tests/results/test_tabular_formset_layout_lt50.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 151da2c..327505c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ # CHANGELOG FOR CRISPY-BOOTSTRAP5 ## Next Release (TBC) -* Added Django 4.2 support -* Added Python 3.11 support +* Added Django 5.0 and 4.2 support +* Added Python 3.11 and 3.12 support * Dropped Python 3.7 support -* Dropped Django 4.0 support +* Dropped Django 3.2, 4.0 and 4.1 support ## 0.7 (2022-09-28) * Added Django 4.1 support diff --git a/crispy_bootstrap5/templates/bootstrap5/layout/help_text.html b/crispy_bootstrap5/templates/bootstrap5/layout/help_text.html index f973773..2f2f147 100644 --- a/crispy_bootstrap5/templates/bootstrap5/layout/help_text.html +++ b/crispy_bootstrap5/templates/bootstrap5/layout/help_text.html @@ -1,7 +1,7 @@ {% if field.help_text %} {% if help_text_inline %} - {{ field.help_text|safe}} + {{ field.help_text|safe}} {% else %} -
{{ field.help_text|safe }}
+
{{ field.help_text|safe }}
{% endif %} {% endif %} diff --git a/pyproject.toml b/pyproject.toml index 4cd6095..292f4a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,9 +14,8 @@ requires-python = ">=3.8" classifiers=[ "Environment :: Web Environment", "Framework :: Django", - "Framework :: Django :: 3.2", - "Framework :: Django :: 4.1", "Framework :: Django :: 4.2", + "Framework :: Django :: 5.0", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", @@ -24,6 +23,7 @@ classifiers=[ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules", @@ -32,7 +32,7 @@ dynamic = [ "version", ] dependencies = [ - "django>=3.2", + "django>=4.2", "django-crispy-forms>=2", ] [project.optional-dependencies] diff --git a/tests/results/field_with_buttons.html b/tests/results/field_with_buttons.html index 6c71570..695c69e 100644 --- a/tests/results/field_with_buttons.html +++ b/tests/results/field_with_buttons.html @@ -3,10 +3,11 @@
- -
Insert your email
+ +
Insert your email
diff --git a/tests/results/field_with_buttons_failing.html b/tests/results/field_with_buttons_failing.html index c6f8489..3542b9d 100644 --- a/tests/results/field_with_buttons_failing.html +++ b/tests/results/field_with_buttons_failing.html @@ -4,7 +4,7 @@ class="asteriskField">*

This field is required.

diff --git a/tests/results/field_with_buttons_failing_lt50.html b/tests/results/field_with_buttons_failing_lt50.html new file mode 100644 index 0000000..c6f8489 --- /dev/null +++ b/tests/results/field_with_buttons_failing_lt50.html @@ -0,0 +1,14 @@ +
+
+
+
+
+

This field is + required.

+
+
+
+
\ No newline at end of file diff --git a/tests/results/field_with_buttons_lt50.html b/tests/results/field_with_buttons_lt50.html new file mode 100644 index 0000000..cd6bf1b --- /dev/null +++ b/tests/results/field_with_buttons_lt50.html @@ -0,0 +1,14 @@ +
+
+
+
+ +
Insert your email
+
+
+
+
\ No newline at end of file diff --git a/tests/results/help_text_escape.html b/tests/results/help_text_escape.html index 7f4e7a0..c1f606d 100644 --- a/tests/results/help_text_escape.html +++ b/tests/results/help_text_escape.html @@ -1,5 +1,5 @@
Insert + class="asteriskField">*
Insert your email
\ No newline at end of file diff --git a/tests/results/help_text_escape_lt50.html b/tests/results/help_text_escape_lt50.html new file mode 100644 index 0000000..2f16a69 --- /dev/null +++ b/tests/results/help_text_escape_lt50.html @@ -0,0 +1,5 @@ +
Insert + your email
+
\ No newline at end of file diff --git a/tests/results/test_bootstrap5_form_inline.html b/tests/results/test_bootstrap5_form_inline.html index 81ed127..ab977d4 100644 --- a/tests/results/test_bootstrap5_form_inline.html +++ b/tests/results/test_bootstrap5_form_inline.html @@ -3,7 +3,7 @@ + placeholder="email" required type="text" aria-describedby="id_email_helptext">
- + This field is required. diff --git a/tests/results/test_clearable_file_field_failing_lt50.html b/tests/results/test_clearable_file_field_failing_lt50.html new file mode 100644 index 0000000..0252c27 --- /dev/null +++ b/tests/results/test_clearable_file_field_failing_lt50.html @@ -0,0 +1,14 @@ +
+
+ +
+ + + This field is required. + +
+
+
\ No newline at end of file diff --git a/tests/results/test_file_field_failing.html b/tests/results/test_file_field_failing.html index 2e479c7..eba751f 100644 --- a/tests/results/test_file_field_failing.html +++ b/tests/results/test_file_field_failing.html @@ -5,7 +5,14 @@ *
- + This field is required. diff --git a/tests/results/test_file_field_failing_lt50.html b/tests/results/test_file_field_failing_lt50.html new file mode 100644 index 0000000..2e479c7 --- /dev/null +++ b/tests/results/test_file_field_failing_lt50.html @@ -0,0 +1,14 @@ +
+
+ +
+ + + This field is required. + +
+
+
\ No newline at end of file diff --git a/tests/results/test_floating_field_failing.html b/tests/results/test_floating_field_failing.html index 793ccce..713077c 100644 --- a/tests/results/test_floating_field_failing.html +++ b/tests/results/test_floating_field_failing.html @@ -1,6 +1,6 @@
-
- diff --git a/tests/results/test_floating_field_failing_lt50.html b/tests/results/test_floating_field_failing_lt50.html new file mode 100644 index 0000000..793ccce --- /dev/null +++ b/tests/results/test_floating_field_failing_lt50.html @@ -0,0 +1,25 @@ + +
+ + + + This field is required. + +
+
+ + + + This field is required. + +
+ diff --git a/tests/results/test_grouped_checkboxes.html b/tests/results/test_grouped_checkboxes.html index 90ac40f..852ece7 100644 --- a/tests/results/test_grouped_checkboxes.html +++ b/tests/results/test_grouped_checkboxes.html @@ -18,7 +18,7 @@ name="checkbox_select_multiple" type="checkbox" value="unknown">
-
+
help
diff --git a/tests/results/test_grouped_checkboxes_failing.html b/tests/results/test_grouped_checkboxes_failing.html index 6ed7662..ebd336e 100644 --- a/tests/results/test_grouped_checkboxes_failing.html +++ b/tests/results/test_grouped_checkboxes_failing.html @@ -2,26 +2,26 @@
Audio -
-
Video -
-
-

This field is required.

-
+
help
diff --git a/tests/results/test_grouped_checkboxes_failing_lt50.html b/tests/results/test_grouped_checkboxes_failing_lt50.html new file mode 100644 index 0000000..3df66b4 --- /dev/null +++ b/tests/results/test_grouped_checkboxes_failing_lt50.html @@ -0,0 +1,28 @@ +
+
+
Audio +
+
Video +
+
+
+

This field is + required.

+
+
+
+ help +
+
+
diff --git a/tests/results/test_grouped_radios_failing.html b/tests/results/test_grouped_radios_failing.html index 4888f75..947240c 100644 --- a/tests/results/test_grouped_radios_failing.html +++ b/tests/results/test_grouped_radios_failing.html @@ -2,19 +2,19 @@
Audio -
-
Video -
-
-

This field is diff --git a/tests/results/test_grouped_radios_failing_lt50.html b/tests/results/test_grouped_radios_failing_lt50.html new file mode 100644 index 0000000..4888f75 --- /dev/null +++ b/tests/results/test_grouped_radios_failing_lt50.html @@ -0,0 +1,25 @@ +

+
+
Audio +
+
Video +
+
+
+

This field is + required.

+
+
+
+ \ No newline at end of file diff --git a/tests/results/test_prepended_appended_text.html b/tests/results/test_prepended_appended_text.html index 3a8ec36..008c1e1 100644 --- a/tests/results/test_prepended_appended_text.html +++ b/tests/results/test_prepended_appended_text.html @@ -2,10 +2,10 @@
-
@<>&@<>&gmail.com
Insert your email
+ class="form-text" id="id_email_helptext">Insert your email