Skip to content

Commit

Permalink
Revert "chore: fix test cases"
Browse files Browse the repository at this point in the history
This reverts commit 948922c.
  • Loading branch information
farhan committed Nov 27, 2024
1 parent 8d99d1b commit 942db0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 4 additions & 5 deletions lms/djangoapps/courseware/tests/test_block_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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()
Expand Down
5 changes: 2 additions & 3 deletions xmodule/tests/test_vertical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}

Expand All @@ -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"
)
Expand Down

0 comments on commit 942db0a

Please sign in to comment.