Commit 83cbc5b9 by Jacek Bzdak

Removed unneccessary code

parent e0fb68ce
...@@ -263,10 +263,10 @@ class ProblemBuilderQuestionnaireBlockTest(ProblemBuilderBaseTest): ...@@ -263,10 +263,10 @@ class ProblemBuilderQuestionnaireBlockTest(ProblemBuilderBaseTest):
self.click_choice(mrq, "Its elegance") self.click_choice(mrq, "Its elegance")
self.assertTrue(submit.is_enabled()) self.assertTrue(submit.is_enabled())
def test_does_not_persist_mcq_feedback_on_page_reload_if_disabled(self, scenario): def test_does_not_persist_mcq_feedback_on_page_reload_if_disabled(self):
with mock.patch("problem_builder.mentoring.MentoringBlock.get_options") as patched_options: with mock.patch("problem_builder.mentoring.MentoringBlock.get_options") as patched_options:
patched_options.return_value = {'pb_mcq_hide_previous_answer': True} patched_options.return_value = {'pb_mcq_hide_previous_answer': True}
mentoring = self.load_scenario(scenario) mentoring = self.load_scenario("feedback_persistence.xml")
answer, mcq, mrq, rating = self._get_controls(mentoring) answer, mcq, mrq, rating = self._get_controls(mentoring)
messages = self._get_messages_element(mentoring) messages = self._get_messages_element(mentoring)
...@@ -376,19 +376,22 @@ class ProblemBuilderQuestionnaireBlockTest(ProblemBuilderBaseTest): ...@@ -376,19 +376,22 @@ class ProblemBuilderQuestionnaireBlockTest(ProblemBuilderBaseTest):
@ddt.data( @ddt.data(
# MCQ with tips # MCQ with tips
("feedback_persistence_mcq_tips.xml", '.choice-tips'), ("feedback_persistence_mcq_tips.xml", '.choice-tips'),
# Like feedback_persistence but instead of tips in MCQ # Like the above but instead of tips in MCQ
# has a question level feedback. This feedback should also be suppressed. # has a question level feedback. This feedback should also be suppressed.
("feedback_persistence_mcq_no_tips.xml", '.feedback') ("feedback_persistence_mcq_no_tips.xml", '.feedback')
) )
def testFeedbackPersistenceTips(self, scenario, tips_selector): def test_feedback_persistence_tips(self, scenario, tips_selector):
mentoring = self.load_scenario(scenario) # Tests whether feedback is hidden on reload.
mcq = self._get_xblock(mentoring, "feedback_mcq_2") with mock.patch("problem_builder.mentoring.MentoringBlock.get_options") as patched_options:
messages = mentoring.find_element_by_css_selector(tips_selector) patched_options.return_value = {'pb_mcq_hide_previous_answer': True}
self.assertFalse(messages.is_displayed()) mentoring = self.load_scenario(scenario)
self.click_choice(mcq, "Yes") mcq = self._get_xblock(mentoring, "feedback_mcq_2")
self.click_submit(mentoring) messages = mentoring.find_element_by_css_selector(tips_selector)
self.assertTrue(messages.is_displayed()) self.assertFalse(messages.is_displayed())
self.reload_student_view() self.click_choice(mcq, "Yes")
mentoring = self.load_scenario(scenario) self.click_submit(mentoring)
messages = mentoring.find_element_by_css_selector(tips_selector) self.assertTrue(messages.is_displayed())
self.assertFalse(messages.is_displayed()) self.reload_student_view()
mentoring = self.load_scenario(scenario)
messages = mentoring.find_element_by_css_selector(tips_selector)
self.assertFalse(messages.is_displayed())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment