From fe5a8de55cf6f75f47acda5e4c314ba7d258caac Mon Sep 17 00:00:00 2001 From: Awais Jibran Date: Thu, 26 Oct 2017 16:19:10 +0500 Subject: [PATCH] Fixing quality --- common/lib/xmodule/xmodule/tests/test_capa_module.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/tests/test_capa_module.py b/common/lib/xmodule/xmodule/tests/test_capa_module.py index ec4e58ff82..ea8e750431 100644 --- a/common/lib/xmodule/xmodule/tests/test_capa_module.py +++ b/common/lib/xmodule/xmodule/tests/test_capa_module.py @@ -459,6 +459,11 @@ class CapaModuleTest(unittest.TestCase): self.assertTrue(still_in_grace.answer_available()) def test_showanswer_answered(self): + """ + Tests that with showanswer="answered" should show answer after the problem is correctly answered. + It should *NOT* show answer if the answer is incorrect. + """ + # Can not see "Show Answer" when student answer is wrong answer_wrong = CapaFactory.create( showanswer=SHOWANSWER.ANSWERED, max_attempts="1", @@ -468,7 +473,7 @@ class CapaModuleTest(unittest.TestCase): ) self.assertFalse(answer_wrong.answer_available()) - + # Expect to see "Show Answer" when answer is correct answer_correct = CapaFactory.create( showanswer=SHOWANSWER.ANSWERED, max_attempts="1", @@ -478,7 +483,6 @@ class CapaModuleTest(unittest.TestCase): ) self.assertTrue(answer_correct.answer_available()) - @ddt.data('', 'other-value') def test_show_correctness_other(self, show_correctness): """