Skip to content

Commit

Permalink
test: is selectable learner waiting review enabled falg
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvente committed Feb 29, 2024
1 parent 6199023 commit 88f1ce2
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions openassessment/xblock/test/test_openassessment.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,31 @@ def test_ora_blocks_listing_view_include_esg_flag(self, xblock, esg_flag_input,
xblock_args_el = tree.xpath(xblock_arg_path)
json.loads(xblock_args_el[0].text)['CONTEXT']['ENHANCED_STAFF_GRADER'] = esg_flag_input

@scenario('data/basic_scenario.xml')
@ddt.data(False, True)
@patch(
'openassessment.xblock.config_mixin.ConfigMixin.is_selectable_learner_waiting_review_enabled',
new_callable=PropertyMock
)
def test_ora_waiting_step_details_view_include_esg_flag(
self, xblock, esg_flag_input, mock_esg):
"""
Test waiting step details view is selectable learner waiting review enabled.
"""
mock_esg.return_value = esg_flag_input
xblock_fragment = self.runtime.render(xblock, "waiting_step_details_view")
body_html = xblock_fragment.body_html()

self.assertIn("WaitingStepDetailsBlock", body_html)

parser = etree.HTMLParser()
tree = etree.parse(StringIO(body_html), parser)

xblock_arg_path = "//script[contains(@type, 'json/xblock-args')]"

xblock_args_el = tree.xpath(xblock_arg_path)
json.loads(xblock_args_el[0].text)['CONTEXT']['selectable_learners_enabled'] = esg_flag_input

@scenario('data/empty_prompt.xml')
def test_prompt_intentionally_empty(self, xblock):
xblock.mfe_views_enabled = True
Expand Down

0 comments on commit 88f1ce2

Please sign in to comment.