diff --git a/common/lib/capa/capa/tests/test_targeted_feedback.py b/common/lib/capa/capa/tests/test_targeted_feedback.py index 24d05124ff..d3268ee2b2 100644 --- a/common/lib/capa/capa/tests/test_targeted_feedback.py +++ b/common/lib/capa/capa/tests/test_targeted_feedback.py @@ -100,7 +100,7 @@ class CapaTargetedFeedbackTest(unittest.TestCase): problem.student_answers = {'1_2_1': 'choice_3'} the_html = problem.get_html() - without_new_lines = the_html.replace("\n", "") + without_new_lines = the_html.replace("\\n", "").replace("\n", "") # pylint: disable=line-too-long self.assertRegexpMatches(without_new_lines, r"\s*Incorrect.*3rd WRONG solution") self.assertNotRegexpMatches(without_new_lines, r"feedback1|feedback2|feedbackC") @@ -114,7 +114,7 @@ class CapaTargetedFeedbackTest(unittest.TestCase): problem.student_answers = {'1_2_1': 'choice_0'} the_html = problem.get_html() - without_new_lines = the_html.replace("\n", "") + without_new_lines = the_html.replace("\\n", "").replace("\n", "") # pylint: disable=line-too-long self.assertRegexpMatches(without_new_lines, r"\s*Incorrect.*1st WRONG solution") self.assertRegexpMatches(without_new_lines, r"
\{.*'1_solution_1'.*\}
") @@ -127,7 +127,7 @@ class CapaTargetedFeedbackTest(unittest.TestCase): problem.student_answers = {'1_2_1': 'choice_2'} the_html = problem.get_html() - without_new_lines = the_html.replace("\n", "") + without_new_lines = the_html.replace("\\n", "").replace("\n", "") # pylint: disable=line-too-long self.assertRegexpMatches(without_new_lines, r"\s*Correct.*Feedback on your correct solution...")