summaryrefslogtreecommitdiff
path: root/www/py-django-bleach/files/patch-bleach6
blob: 157e9581e2064f54c160f94c4ed3044d9010e69f (plain) (blame)
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
--- django_bleach/tests/test_forms.py.orig	2023-08-05 01:36:02 UTC
+++ django_bleach/tests/test_forms.py
@@ -127,7 +127,7 @@ class TestCustomWidget(TestCase):
             # Define form inside function with overridden settings so
             # get_default_widget() sees the modified setting.
             no_tags = BleachField(
-                max_length=100, strip_tags=True, allowed_tags=[]
+                max_length=100, strip_tags=True, allowed_tags={}
             )
             no_strip = BleachField(
                 max_length=100, allowed_tags=None, allowed_attributes=None
--- setup.py.orig	2023-08-05 01:36:02 UTC
+++ setup.py
@@ -43,7 +43,7 @@ setup(
     license="MIT",
     packages=find_packages(exclude=("testproject*",)),
     install_requires=[
-        "bleach[css]>=5,<6",
+        "bleach[css]>=5",
         "Django>=3.2",
     ],
     python_requires=">=3.8",
--- testproject/constants.py.orig	2023-08-05 01:36:02 UTC
+++ testproject/constants.py
@@ -2,11 +2,11 @@ ALLOWED_ATTRIBUTES = {"*": ["class", "style"], "a": ["
 
 ALLOWED_CSS_PROPERTIES = ["color"]
 
-ALLOWED_PROTOCOLS = [
+ALLOWED_PROTOCOLS = {
     "https",
     "data",
-]
+}
 
 ALLOWED_STYLES = ALLOWED_CSS_PROPERTIES
 
-ALLOWED_TAGS = ["a", "li", "ul"]
+ALLOWED_TAGS = {"a", "li", "ul"}
--- testproject/forms.py.orig	2023-08-05 01:36:02 UTC
+++ testproject/forms.py
@@ -23,7 +23,7 @@ class CustomBleachWidget(forms.Textarea):
 class BleachForm(forms.Form):
     """Form for testing BleachField"""
 
-    no_tags = BleachField(max_length=100, strip_tags=True, allowed_tags=[])
+    no_tags = BleachField(max_length=100, strip_tags=True, allowed_tags={})
 
     no_strip = BleachField(
         max_length=100, allowed_tags=None, allowed_attributes=None
--- testproject/models.py.orig	2023-08-05 01:36:02 UTC
+++ testproject/models.py
@@ -10,9 +10,9 @@ class Person(models.Model):
     biography = BleachField(
         max_length=100,
         verbose_name="Person biography",
-        allowed_tags=["p", "a", "li", "ul", "strong"],
+        allowed_tags={"p", "a", "li", "ul", "strong"},
         allowed_attributes=["class", "href", "style"],
-        allowed_protocols=["http", "https"],
+        allowed_protocols={"http", "https"},
         css_sanitizer=CSSSanitizer(
             allowed_css_properties=["color", "background-color"]
         ),