File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def __init__(
63
63
additional_attributes [tag ] = attributes
64
64
65
65
if additional_attributes :
66
- self .ALLOWED_TAGS |= set ( key for key in additional_attributes .keys () if key != "*" )
66
+ self .ALLOWED_TAGS |= { key for key in additional_attributes .keys () if key != "*" }
67
67
for tag , attributes in additional_attributes .items ():
68
68
self .ALLOWED_ATTRIBUTES [tag ] = self .ALLOWED_ATTRIBUTES .get (tag , set ()) | attributes
69
69
Original file line number Diff line number Diff line change 1
- from unittest import skipIf
2
1
from unittest .mock import patch , MagicMock
3
2
4
3
from cms .api import create_page , add_plugin
@@ -19,11 +18,9 @@ def test_default_tag_removal(self):
19
18
full = False ,
20
19
cleaner = NH3Parser (),
21
20
)
22
- self .assertNotIn (
23
- "iframe" , NH3Parser ().ALLOWED_TAGS
24
- )
21
+ self .assertNotIn ("iframe" , NH3Parser ().ALLOWED_TAGS )
25
22
self .assertEqual (
26
- '' ,
23
+ "" ,
27
24
text ,
28
25
)
29
26
@@ -77,11 +74,7 @@ def test_default_protocol_removal(self):
77
74
78
75
def test_custom_protocol_enabled (self ):
79
76
settings .TEXT_ADDITIONAL_PROTOCOLS = ["rtmp" ]
80
- text = html .clean_html (
81
- '<source src="rtmp://testurl.com/">' ,
82
- full = False ,
83
- cleaner = NH3Parser ()
84
- )
77
+ text = html .clean_html ('<source src="rtmp://testurl.com/">' , full = False , cleaner = NH3Parser ())
85
78
self .assertEqual ('<source src="rtmp://testurl.com/">' , text )
86
79
87
80
def test_clean_html_with_sanitize_enabled (self ):
You can’t perform that action at this time.
0 commit comments