14 lines
648 B
Python
14 lines
648 B
Python
"""计划下单时间显示格式回归检查。"""
|
|
import unittest
|
|
from pathlib import Path
|
|
ROOT=Path(__file__).resolve().parents[1]
|
|
APP=(ROOT/'static/js/app.js').read_text(encoding='utf-8')
|
|
class PlanOrderTimeDisplayTest(unittest.TestCase):
|
|
def test_display_formatter_exists_and_keeps_raw_value_contract(self):
|
|
self.assertIn('window._formatPlanOrderTime',APP)
|
|
self.assertIn("return datePart + ' 00:00'",APP)
|
|
self.assertIn("return datePart + ' ' + hh + ':' + mm",APP)
|
|
def test_order_lists_use_formatter(self):
|
|
self.assertGreaterEqual(APP.count('_formatPlanOrderTime(r[\'计划下单时间\']'),3)
|
|
if __name__=='__main__':unittest.main()
|