Skip to content

Commit 9a7d4da

Browse files
committed
fix linting issues
1 parent 656e8a3 commit 9a7d4da

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

djangocms_text/html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __init__(
6363
additional_attributes[tag] = attributes
6464

6565
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 != "*"}
6767
for tag, attributes in additional_attributes.items():
6868
self.ALLOWED_ATTRIBUTES[tag] = self.ALLOWED_ATTRIBUTES.get(tag, set()) | attributes
6969

tests/test_html.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from unittest import skipIf
21
from unittest.mock import patch, MagicMock
32

43
from cms.api import create_page, add_plugin
@@ -19,11 +18,9 @@ def test_default_tag_removal(self):
1918
full=False,
2019
cleaner=NH3Parser(),
2120
)
22-
self.assertNotIn(
23-
"iframe", NH3Parser().ALLOWED_TAGS
24-
)
21+
self.assertNotIn("iframe", NH3Parser().ALLOWED_TAGS)
2522
self.assertEqual(
26-
'',
23+
"",
2724
text,
2825
)
2926

@@ -77,11 +74,7 @@ def test_default_protocol_removal(self):
7774

7875
def test_custom_protocol_enabled(self):
7976
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())
8578
self.assertEqual('<source src="rtmp://testurl.com/">', text)
8679

8780
def test_clean_html_with_sanitize_enabled(self):

0 commit comments

Comments
 (0)