Skip to content

Commit 1830e21

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent da81a43 commit 1830e21

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

tests/test_widgets.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,19 @@ def test_widget_media_applied_cache_suffix(self):
128128
tinymce_version = "6.8"
129129

130130
orig_config = tinymce.settings.DEFAULT_CONFIG
131-
with patch.dict(tinymce.settings.DEFAULT_CONFIG, {**orig_config, "cache_suffix": f"?ver={tinymce_version}"}):
131+
with patch.dict(
132+
tinymce.settings.DEFAULT_CONFIG,
133+
{**orig_config, "cache_suffix": f"?ver={tinymce_version}"},
134+
):
132135
widget = TinyMCE()
133136

134137
self.assertEqual(list(widget.media.render_css()), [])
135138
self.assertEqual(
136139
widget.media.render_js(),
137140
[
138141
f'<script src="/tinymce/compressor/?ver={tinymce_version}"></script>',
139-
f'<script src="/static/django_tinymce/init_tinymce.js?ver={tinymce_version}"></script>'
140-
]
142+
f'<script src="/static/django_tinymce/init_tinymce.js?ver={tinymce_version}"></script>',
143+
],
141144
)
142145

143146
def test_tinymce_widget_required(self):
@@ -158,7 +161,7 @@ def test_tinymce_widget_allow_translated_options(self):
158161
orig_config = tinymce.settings.DEFAULT_CONFIG
159162
style_formats = [{"title": gettext_lazy("Awesome style"), "inline": "strong"}]
160163
with patch.dict(
161-
tinymce.settings.DEFAULT_CONFIG, {**orig_config, "style_formats": style_formats}
164+
tinymce.settings.DEFAULT_CONFIG, {**orig_config, "style_formats": style_formats}
162165
):
163166
html = widget.render("foobar", "lorem ipsum", attrs={"id": "id_foobar"})
164167
self.assertIn("Awesome style", html)

tinymce/widgets.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ def _media(self):
115115
media = property(_media)
116116

117117
def _render_js(self):
118-
revision_parameter = tinymce.settings.DEFAULT_CONFIG.get('cache_suffix', '')
118+
revision_parameter = tinymce.settings.DEFAULT_CONFIG.get("cache_suffix", "")
119119

120120
return [
121121
format_html(
122-
'<script src="{}{}"></script>',
123-
(self.absolute_path(path)), revision_parameter)
122+
'<script src="{}{}"></script>', (self.absolute_path(path)), revision_parameter
123+
)
124124
for path in self._js
125125
]
126126

0 commit comments

Comments
 (0)