@@ -275,7 +275,6 @@ def test_approval_response_includes_reviewer_notes_in_notification(auth_client,
275275 assert notification is not None , "Notification should be created for approval response"
276276 assert reviewer_notes in notification .message , f"Reviewer notes should be in message. Got: { notification .message } "
277277 assert "Notes:" in notification .message , "Message should include 'Notes:' label"
278- assert "```" in notification .message , "Notes should be wrapped in code block"
279278
280279
281280def test_decline_response_includes_reviewer_notes_in_notification (auth_client , test_pre_award_step , loaded_db ):
@@ -306,7 +305,6 @@ def test_decline_response_includes_reviewer_notes_in_notification(auth_client, t
306305 assert notification is not None , "Notification should be created for decline response"
307306 assert reviewer_notes in notification .message , f"Reviewer notes should be in message. Got: { notification .message } "
308307 assert "Notes:" in notification .message , "Message should include 'Notes:' label"
309- assert "```" in notification .message , "Notes should be wrapped in code block"
310308
311309
312310def test_approval_response_excludes_empty_reviewer_notes (auth_client , test_pre_award_step , loaded_db ):
@@ -398,12 +396,12 @@ def test_reviewer_notes_prevent_markdown_injection(auth_client, test_pre_award_s
398396 ).first ()
399397
400398 assert notification is not None , "Notification should be created"
401- # Verify notes are wrapped in 5-backtick code block (prevents Markdown rendering)
402- assert "````` " in notification .message , "Notes should be wrapped in 5-backtick code block "
403- # Verify the raw Markdown syntax is preserved as plain text
404- assert "* *Bold* *" in notification .message , "Markdown syntax should be preserved literally "
405- assert "[link]" in notification .message , "Link syntax should be preserved literally "
406- assert "`` `code`` `" in notification .message , "Triple backticks should be preserved literally "
399+ # Verify notes are included in the message
400+ assert "Notes: " in notification .message , "Message should include 'Notes:' label "
401+ # Verify the Markdown syntax is escaped to prevent rendering
402+ assert "\\ * \\ *Bold\\ * \\ *" in notification .message , "Asterisks should be escaped "
403+ assert "\\ [link\\ ]" in notification .message , "Brackets should be escaped "
404+ assert "\\ ` \\ ` \\ `code\\ ` \\ ` \\ `" in notification .message , "Backticks should be escaped "
407405
408406
409407def test_reviewer_notes_backtick_injection_prevented (auth_client , test_pre_award_step , loaded_db ):
@@ -432,9 +430,9 @@ def test_reviewer_notes_backtick_injection_prevented(auth_client, test_pre_award
432430 ).first ()
433431
434432 assert notification is not None , "Notification should be created"
435- # Verify 5-backtick fence is used
436- assert notification . message . count ( "`````" ) == 2 , "Should have opening and closing 5-backtick fences "
437- # Verify triple backticks are contained within the fence (appear in raw form)
438- assert "`` `" in notification .message , "Triple backticks should be preserved "
439- # Verify the markdown after triple backticks is also preserved literally
440- assert "* *This should NOT render as bold* *" in notification .message , "Markdown after backticks should be literal "
433+ # Verify notes are included in the message
434+ assert "Notes:" in notification . message , "Message should include 'Notes:' label "
435+ # Verify triple backticks are escaped
436+ assert "\\ ` \\ ` \\ `" in notification .message , "Triple backticks should be escaped "
437+ # Verify the markdown after triple backticks is also escaped
438+ assert "\\ * \\ *This should NOT render as bold\\ * \\ *" in notification .message , "Asterisks should be escaped "
0 commit comments