diff --git a/lms/djangoapps/courseware/tests/test_block_render.py b/lms/djangoapps/courseware/tests/test_block_render.py index 3b4334335a6f..182f8d0c03ab 100644 --- a/lms/djangoapps/courseware/tests/test_block_render.py +++ b/lms/djangoapps/courseware/tests/test_block_render.py @@ -1550,8 +1550,8 @@ def test_xblock_display_wrapper_enabled(self): wrap_xblock_display=True, ) result_fragment = block.render(STUDENT_VIEW) - html_block_identifier = f"div.xblock.xblock-student_view.xmodule_{HtmlBlock.__name__}" - assert len(PyQuery(result_fragment.content)(html_block_identifier)) == 1 + + assert len(PyQuery(result_fragment.content)('div.xblock.xblock-student_view.xmodule_HtmlBlock')) == 1 def test_xmodule_display_wrapper_disabled(self): block = render.get_block( @@ -2573,12 +2573,11 @@ def test_get_item(self): def test_dynamic_updates(self): """Tests that the list of disabled xblocks can dynamically update.""" course = CourseFactory() - block = f"{ProblemBlock.__name__}WithMixins" - item_usage_id = self._verify_block('problem', course, block) + item_usage_id = self._verify_block('problem', course, 'ProblemBlockWithMixins') XBlockConfiguration(name='problem', enabled=False).save() # First verify that the cached value is used until there is a new request cache. - self._verify_block('problem', course, block, item_usage_id) + self._verify_block('problem', course, 'ProblemBlockWithMixins', item_usage_id) # Now simulate a new request cache. self.store.request_cache.data.clear() diff --git a/xmodule/tests/test_vertical.py b/xmodule/tests/test_vertical.py index 426569f1ab11..a3c596d253ac 100644 --- a/xmodule/tests/test_vertical.py +++ b/xmodule/tests/test_vertical.py @@ -18,7 +18,6 @@ from openedx_filters import PipelineStep from openedx_filters.learning.filters import VerticalBlockChildRenderStarted, VerticalBlockRenderCompleted -from ..html_block import HtmlBlock from ..x_module import AUTHOR_VIEW, PUBLIC_VIEW, STUDENT_VIEW from . import prepare_block_runtime from .helpers import StubUserService @@ -90,7 +89,7 @@ class TestVerticalBlockChildRenderStep(PipelineStep): def run_filter(self, block, context): # lint-amnesty, pylint: disable=arguments-differ """Pipeline step that changes child content""" - if type(block).__name__ == f"{HtmlBlock.__name__}WithMixins": + if type(block).__name__ == "HtmlBlockWithMixins": block.get_html = lambda: TestVerticalBlockChildRenderStep.filter_content return {"block": block, "context": context} @@ -102,7 +101,7 @@ class TestPreventVerticalBlockChildRender(PipelineStep): def run_filter(self, block, context): # lint-amnesty, pylint: disable=arguments-differ """Pipeline step that raises exceptions during child block rendering""" - if type(block).__name__ == f"{HtmlBlock.__name__}WithMixins": + if type(block).__name__ == "HtmlBlockWithMixins": raise VerticalBlockChildRenderStarted.PreventChildBlockRender( "Skip block test exception" )