feat(inout): 발주 메일 본문 서식 막대(크기·굵게·색·정렬·목록·링크 등)
미리보기 위 서식 막대로 고른 글자의 서식을 바꾼다(execCommand, 표·인라인 서식 유지). 서버는 밑줄·취소선 text-decoration-line 을 메일용 text-decoration 으로 바꿔 보낸다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -419,6 +419,19 @@ class OrderMailEditTests(OrderNoticeMailTests):
|
||||
self.assertIn("MW-0320 | 5,500", factory.get_body(("plain",)).get_content()) # 글 버전도 고친 본문에서
|
||||
self.assertIn("PO-261019-01", notice.get_body(("html",)).get_content()) # 알림은 서버가 만든 내용
|
||||
|
||||
def test_toolbar_formats_kept(self):
|
||||
"""서식 막대(execCommand) 결과 — 크기·굵게·색·배경·밑줄(text-decoration-line → text-decoration)·링크·목록·정렬."""
|
||||
h = s.clean_mail_html(
|
||||
'<span style="font-size: 20px; text-decoration-line: underline;">이석준님</span>'
|
||||
'<span style="font-weight: bold; color: rgb(217, 48, 37);">굵게</span>'
|
||||
'<span style="background-color: rgb(255, 243, 191);">배경</span><a href="https://dbxcorp.co.kr">링크</a>'
|
||||
'<a href="javascript:alert(1)">나쁜 링크</a><ol><li>하나</li></ol><div style="text-align: center;">가운데</div>')
|
||||
for part in ('<span style="font-size:20px;text-decoration:underline">이석준님</span>',
|
||||
'<span style="font-weight:bold;color:rgb(217, 48, 37)">굵게</span>',
|
||||
'<span style="background-color:rgb(255, 243, 191)">배경</span>', '<a href="https://dbxcorp.co.kr">링크</a>',
|
||||
"<a>나쁜 링크</a>", "<ol><li>하나</li></ol>", '<div style="text-align:center">가운데</div>'):
|
||||
self.assertIn(part, h)
|
||||
|
||||
def test_empty_edited_body_rejected(self):
|
||||
r = self._post({"html": "<p> <br></p>"})
|
||||
self.assertEqual(r.status_code, 400)
|
||||
|
||||
Reference in New Issue
Block a user