Commit fe5a8de5 by Awais Jibran

Fixing quality

parent a428c081
...@@ -459,6 +459,11 @@ class CapaModuleTest(unittest.TestCase): ...@@ -459,6 +459,11 @@ class CapaModuleTest(unittest.TestCase):
self.assertTrue(still_in_grace.answer_available()) self.assertTrue(still_in_grace.answer_available())
def test_showanswer_answered(self): 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( answer_wrong = CapaFactory.create(
showanswer=SHOWANSWER.ANSWERED, showanswer=SHOWANSWER.ANSWERED,
max_attempts="1", max_attempts="1",
...@@ -468,7 +473,7 @@ class CapaModuleTest(unittest.TestCase): ...@@ -468,7 +473,7 @@ class CapaModuleTest(unittest.TestCase):
) )
self.assertFalse(answer_wrong.answer_available()) self.assertFalse(answer_wrong.answer_available())
# Expect to see "Show Answer" when answer is correct
answer_correct = CapaFactory.create( answer_correct = CapaFactory.create(
showanswer=SHOWANSWER.ANSWERED, showanswer=SHOWANSWER.ANSWERED,
max_attempts="1", max_attempts="1",
...@@ -478,7 +483,6 @@ class CapaModuleTest(unittest.TestCase): ...@@ -478,7 +483,6 @@ class CapaModuleTest(unittest.TestCase):
) )
self.assertTrue(answer_correct.answer_available()) self.assertTrue(answer_correct.answer_available())
@ddt.data('', 'other-value') @ddt.data('', 'other-value')
def test_show_correctness_other(self, show_correctness): def test_show_correctness_other(self, show_correctness):
""" """
......
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