@@ -124,6 +124,22 @@ def test_tinymce_widget_media(self):
124124 ],
125125 )
126126
127+ def test_widget_media_applied_cache_suffix (self ):
128+ tinymce_version = "6.8"
129+
130+ orig_config = tinymce .settings .DEFAULT_CONFIG
131+ with patch .dict (tinymce .settings .DEFAULT_CONFIG , {** orig_config , "cache_suffix" : f"?ver={ tinymce_version } " }):
132+ widget = TinyMCE ()
133+
134+ self .assertEqual (list (widget .media .render_css ()), [])
135+ self .assertEqual (
136+ widget .media .render_js (),
137+ [
138+ f'<script src="/tinymce/compressor/?ver={ tinymce_version } "></script>' ,
139+ f'<script src="/static/django_tinymce/init_tinymce.js?ver={ tinymce_version } "></script>'
140+ ]
141+ )
142+
127143 def test_tinymce_widget_required (self ):
128144 """
129145 The TinyMCE widget should never output the required HTML attribute, even
@@ -142,7 +158,7 @@ def test_tinymce_widget_allow_translated_options(self):
142158 orig_config = tinymce .settings .DEFAULT_CONFIG
143159 style_formats = [{"title" : gettext_lazy ("Awesome style" ), "inline" : "strong" }]
144160 with patch .dict (
145- tinymce .settings .DEFAULT_CONFIG , {** orig_config , "style_formats" : style_formats }
161+ tinymce .settings .DEFAULT_CONFIG , {** orig_config , "style_formats" : style_formats }
146162 ):
147163 html = widget .render ("foobar" , "lorem ipsum" , attrs = {"id" : "id_foobar" })
148164 self .assertIn ("Awesome style" , html )
0 commit comments