From a231876493e4ae4248a002f70f8e05448fe5e1b3 Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Wed, 9 Oct 2019 11:42:07 +0500 Subject: [PATCH] BOM-799 \\n\\n was coming inside the html. Clean it. --- common/lib/capa/capa/tests/test_targeted_feedback.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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...")