25 lines
892 B
Python
25 lines
892 B
Python
"""登录页与系统导航名称回归测试。"""
|
|
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
LOGIN_HTML = (ROOT / 'templates/login.html').read_text(encoding='utf-8')
|
|
BASE_HTML = (ROOT / 'templates/base.html').read_text(encoding='utf-8')
|
|
|
|
|
|
class SystemBrandingTest(unittest.TestCase):
|
|
def test_login_uses_full_management_system_name(self):
|
|
self.assertIn('<h1>蝶雅采购管理系统</h1>', LOGIN_HTML)
|
|
self.assertIn('<title>蝶雅采购管理系统 - 登录</title>', LOGIN_HTML)
|
|
self.assertNotIn('蝶雅采购智能体平台', LOGIN_HTML)
|
|
|
|
def test_sidebar_uses_short_management_system_name(self):
|
|
self.assertIn('<span class="sidebar-title">采购管理系统</span>', BASE_HTML)
|
|
self.assertIn('<title>蝶雅采购管理系统</title>', BASE_HTML)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|