31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
"""计划预测 SKU 详情弹窗 BOM 列对齐回归测试。"""
|
|
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
|
|
APP_JS = (Path(__file__).resolve().parents[1] / 'static/js/app.js').read_text(encoding='utf-8')
|
|
|
|
|
|
class PlanningBomPopupColumnsTest(unittest.TestCase):
|
|
def test_bom_headers_include_supplier_between_name_and_inventory(self):
|
|
header_sequence = (
|
|
'\\u7269\\u6599\\u540d\\u79f0</th>'
|
|
'<th style="text-align:center">\\u4f9b\\u5e94\\u5546</th>'
|
|
'<th style="text-align:center">\\u53ef\\u7528\\u5e93\\u5b58</th>'
|
|
)
|
|
self.assertGreaterEqual(APP_JS.count(header_sequence), 2)
|
|
|
|
def test_bom_rows_render_supplier_before_inventory(self):
|
|
row_sequence = (
|
|
"escHtml(m.material_name) + '</td>' +\n"
|
|
" '<td style=\"text-align:center\">' + "
|
|
"(bomCanSupplier ? escHtml(m.material_supplier || '-') : '-') + '</td>' +\n"
|
|
" '<td style=\"text-align:center\">' + m.available_qty.toLocaleString()"
|
|
)
|
|
self.assertGreaterEqual(APP_JS.count(row_sequence), 2)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|