feat(inout): 발주 메일 첫 요약 표를 4열(항목·값 두 쌍씩) 4×4로

- 예전 2열 × 8행 → 4열 × 4행, 요청 사항은 맨 아래 한 줄 전체

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 12:20:27 +09:00
parent 86720d073e
commit cb69b086d7
4 changed files with 28 additions and 4 deletions
+13
View File
@@ -173,6 +173,19 @@ class MailPriceTests(unittest.TestCase):
self.assertIn(part, h)
self.assertNotIn("PP(g/개)", h)
self.assertLess(h.index("PP 사용량(kg)"), h.index("은(Ag) 함유량")) # PP 사용량 열은 은 함유량 왼쪽
# 첫 요약 표 = 4열(항목·값 두 쌍씩), 8칸 → 4줄. 요청 사항은 맨 아래 한 줄 전체(colspan 3)
import re
facts_tbl = h.split("</table>", 1)[0]
rows = re.findall(r"<tr>(.*?)</tr>", facts_tbl)
body = [r for r in rows if "요청 사항" not in r]
self.assertEqual(len(body), 4)
self.assertTrue(all(r.count("<th") == 2 and r.count("<td") == 2 for r in body))
self.assertIn("발주번호</th>", body[0]) and self.assertIn("발주일</th>", body[0])
self.assertIn("PP 사용량</th>", body[3]) and self.assertIn("은(Ag) 총량</th>", body[3])
memo_rows = [r for r in rows if "요청 사항" in r]
self.assertEqual(len(memo_rows), 1 if o.get("memo") else 0)
if memo_rows:
self.assertIn('colspan="3"', memo_rows[0])
o2 = _order() # 단가가 하나도 없으면 금액 줄은 "-"
t2 = s.order_mail(o2, sender_name="K", sender_email="k@x.com")["text"]
self.assertNotIn("전체 무게:", t2)