File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,29 @@ def test_integrity(self):
229229 result .rendered_content
230230 )
231231
232+ def test_integrity_missing_config (self ):
233+ self .compile_bundles ('webpack.config.integrity.js' )
234+
235+ loader = get_loader (DEFAULT_CONFIG )
236+ # remove INTEGRITY from config completely to test backward compatibility
237+ integrity_from_config = loader .config .pop ('INTEGRITY' )
238+
239+ view = TemplateView .as_view (template_name = 'single.html' )
240+ request = self .factory .get ('/' )
241+ result = view (request )
242+
243+ self .assertIn ((
244+ '<script src="/static/django_webpack_loader_bundles/main.js" >'
245+ '</script>' ), result .rendered_content
246+ )
247+ self .assertIn ((
248+ '<link href="/static/django_webpack_loader_bundles/main.css" rel="stylesheet" />' ),
249+ result .rendered_content
250+ )
251+
252+ # return removed key
253+ loader .config ['INTEGRITY' ] = integrity_from_config
254+
232255 def test_integrity_missing_hash (self ):
233256 self .compile_bundles ('webpack.config.simple.js' )
234257
You can’t perform that action at this time.
0 commit comments