diff --git a/cms/conftest.py b/cms/conftest.py index 80d971070a..131ea8e048 100644 --- a/cms/conftest.py +++ b/cms/conftest.py @@ -40,23 +40,3 @@ def _django_clear_site_cache(): with what has been working for us so far. """ pass # lint-amnesty, pylint: disable=unnecessary-pass - - -@pytest.fixture(autouse=True) -def no_webpack_loader(monkeypatch): - """ - Monkeypatch webpack_loader to make sure that webpack assets don't need to be - compiled before unit tests are run. - """ - monkeypatch.setattr( - "webpack_loader.templatetags.webpack_loader.render_bundle", - lambda entry, extension=None, config='DEFAULT', attrs='': '' - ) - monkeypatch.setattr( - "webpack_loader.utils.get_as_tags", - lambda entry, extension=None, config='DEFAULT', attrs='': [] - ) - monkeypatch.setattr( - "webpack_loader.utils.get_files", - lambda entry, extension=None, config='DEFAULT', attrs='': [] - ) diff --git a/cms/envs/test.py b/cms/envs/test.py index 1e249f18d0..9a294bf10b 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -70,6 +70,7 @@ TEST_ROOT = path("test_root") # Want static files in the same dir for running on jenkins. STATIC_ROOT = TEST_ROOT / "staticfiles" WEBPACK_LOADER["DEFAULT"]["STATS_FILE"] = STATIC_ROOT / "webpack-stats.json" +WEBPACK_LOADER['DEFAULT']['LOADER_CLASS'] = 'webpack_loader.loader.FakeWebpackLoader' GITHUB_REPO_ROOT = TEST_ROOT / "data" DATA_DIR = TEST_ROOT / "data" diff --git a/common/djangoapps/pipeline_mako/templates/static_content.html b/common/djangoapps/pipeline_mako/templates/static_content.html index a5a2a575b0..fc80c77e9e 100644 --- a/common/djangoapps/pipeline_mako/templates/static_content.html +++ b/common/djangoapps/pipeline_mako/templates/static_content.html @@ -147,7 +147,7 @@ if not source: <% body = capture(caller.body) %> - ${HTML(render_bundle(entry, extension=None, config='DEFAULT', attrs=attrs))} + ${HTML(render_bundle(context, entry, extension=None, config='DEFAULT', attrs=attrs))} % if body: