File: use_bootstrap5.patch

package info (click to toggle)
python-django-crispy-forms 2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,056 kB
  • sloc: python: 3,078; makefile: 88
file content (73 lines) | stat: -rw-r--r-- 2,643 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Description: allow only bootstrap3 and 5, which are in debian
Forwarded: not-needed
Author: Jérémy Lal <kapouer@melix.org>
--- a/tests/templates/custom_field_template.html
+++ b/tests/templates/custom_field_template.html
@@ -1,2 +1,2 @@
 <h1>Special custom field</h1>
-{% include 'bootstrap4/field.html' %}
+{% include 'bootstrap5/field.html' %}
--- a/tests/templates/custom_form_template.html
+++ b/tests/templates/custom_form_template.html
@@ -1,2 +1,2 @@
 <h1>Special custom form</h1>
-{% include "bootstrap4/whole_uni_form.html" %}
+{% include "bootstrap5/whole_uni_form.html" %}
--- a/tests/templates/custom_form_template_with_context.html
+++ b/tests/templates/custom_form_template_with_context.html
@@ -1,4 +1,4 @@
 <h1>Special custom form with context passthrough</h1>
 Got prefix: {{ prefix }}.
-{% include "bootstrap4/whole_uni_form.html" %}
+{% include "bootstrap5/whole_uni_form.html" %}
 Got suffix: {{ suffix }}.
--- a/tests/test_form_helper.py
+++ b/tests/test_form_helper.py
@@ -194,10 +194,10 @@
 
 def test_template_pack_override_compact(settings):
     current_pack = settings.CRISPY_TEMPLATE_PACK
-    if current_pack == "bootstrap4":
+    if current_pack == "bootstrap5":
         override_pack = "bootstrap3"
     else:
-        override_pack = "bootstrap4"
+        override_pack = "bootstrap5"
 
     # {% crispy form 'template_pack_name' %}
     template = Template(
@@ -218,10 +218,10 @@
 
 def test_template_pack_override_verbose(settings):
     current_pack = settings.CRISPY_TEMPLATE_PACK
-    if current_pack == "bootstrap4":
+    if current_pack == "bootstrap5":
         override_pack = "bootstrap3"
     else:
-        override_pack = "bootstrap4"
+        override_pack = "bootstrap5"
 
     # {% crispy form helper 'template_pack_name' %}
     template = Template(
--- a/tests/test_settings.py
+++ b/tests/test_settings.py
@@ -10,7 +10,7 @@
     "crispy_forms",
     "tests",
     "crispy_bootstrap3",
-    "crispy_bootstrap4",
+    "crispy_bootstrap5",
 )
 
 DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}
--- a/crispy_forms/templatetags/crispy_forms_tags.py
+++ b/crispy_forms/templatetags/crispy_forms_tags.py
@@ -257,7 +257,7 @@
     if template_pack is not None:
         template_pack = template_pack[1:-1]
         ALLOWED_TEMPLATE_PACKS = getattr(
-            settings, "CRISPY_ALLOWED_TEMPLATE_PACKS", ("uni_form", "bootstrap3", "bootstrap4")
+            settings, "CRISPY_ALLOWED_TEMPLATE_PACKS", ("uni_form", "bootstrap3", "bootstrap5")
         )
         if template_pack not in ALLOWED_TEMPLATE_PACKS:
             raise template.TemplateSyntaxError(