From c3fce9d9cc56e65ac6ad533a5c8c83ab6d283bbc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:40:22 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_widgets.py | 11 +++++++---- tinymce/widgets.py | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/test_widgets.py b/tests/test_widgets.py index 99b0f92a..35d4c540 100644 --- a/tests/test_widgets.py +++ b/tests/test_widgets.py @@ -128,7 +128,10 @@ def test_widget_media_applied_cache_suffix(self): tinymce_version = "6.8" orig_config = tinymce.settings.DEFAULT_CONFIG - with patch.dict(tinymce.settings.DEFAULT_CONFIG, {**orig_config, "cache_suffix": f"?ver={tinymce_version}"}): + with patch.dict( + tinymce.settings.DEFAULT_CONFIG, + {**orig_config, "cache_suffix": f"?ver={tinymce_version}"}, + ): widget = TinyMCE() self.assertEqual(list(widget.media.render_css()), []) @@ -136,8 +139,8 @@ def test_widget_media_applied_cache_suffix(self): widget.media.render_js(), [ f'', - f'' - ] + f'', + ], ) def test_tinymce_widget_required(self): @@ -158,7 +161,7 @@ def test_tinymce_widget_allow_translated_options(self): orig_config = tinymce.settings.DEFAULT_CONFIG style_formats = [{"title": gettext_lazy("Awesome style"), "inline": "strong"}] with patch.dict( - tinymce.settings.DEFAULT_CONFIG, {**orig_config, "style_formats": style_formats} + tinymce.settings.DEFAULT_CONFIG, {**orig_config, "style_formats": style_formats} ): html = widget.render("foobar", "lorem ipsum", attrs={"id": "id_foobar"}) self.assertIn("Awesome style", html) diff --git a/tinymce/widgets.py b/tinymce/widgets.py index b7066f34..27809067 100644 --- a/tinymce/widgets.py +++ b/tinymce/widgets.py @@ -115,12 +115,12 @@ def _media(self): media = property(_media) def _render_js(self): - revision_parameter = tinymce.settings.DEFAULT_CONFIG.get('cache_suffix', '') + revision_parameter = tinymce.settings.DEFAULT_CONFIG.get("cache_suffix", "") return [ format_html( - '', - (self.absolute_path(path)), revision_parameter) + '', (self.absolute_path(path)), revision_parameter + ) for path in self._js ]