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 ed1f67b commit 67c1470
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions openassessment/xblock/test/test_openassessment.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,6 @@ def test__create_ui_models__no_leaderboard_if_teams_enabled(self, xblock):
'openassessment.xblock.config_mixin.ConfigMixin.is_enhanced_staff_grader_enabled',
PropertyMock(return_value=False)
)
@patch(
'openassessment.xblock.config_mixin.ConfigMixin.is_selectable_learner_waiting_review_enabled',
PropertyMock(return_value=False)
)
def test_ora_blocks_listing_view(self, xblock):
"""
Test view for listing all courses OA blocks.
Expand Down Expand Up @@ -288,6 +284,32 @@ 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 67c1470

Please sign in to comment.