# -*- coding: utf-8 -*- """ 纯粹务实工程文案专项测试 (Natural Copywriting & No AI Buzzwords Test) 测试驱动去 AI 化、去除泛化通用口号与翻译腔,强化大厂务实工程与业务场景语言。 """ import os import unittest ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) class TestNaturalCopywriting(unittest.TestCase): def setUp(self): self.index_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_home/index.html') self.services_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_product/service_page.html') self.products_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_product/product_page.html') self.cases_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_case_show/list.html') self.about_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_home/single.html') self.contact_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_online_message/list.html') with open(self.index_path, 'r', encoding='utf-8') as f: self.index_html = f.read() with open(self.services_path, 'r', encoding='utf-8') as f: self.services_html = f.read() with open(self.products_path, 'r', encoding='utf-8') as f: self.products_html = f.read() with open(self.cases_path, 'r', encoding='utf-8') as f: self.cases_html = f.read() with open(self.about_path, 'r', encoding='utf-8') as f: self.about_html = f.read() with open(self.contact_path, 'r', encoding='utf-8') as f: self.contact_html = f.read() def test_forbid_ai_buzzwords_and_translationese(self): """严格禁止典型 AI 假大空口号、翻译腔与泛化套话""" self.footer_path = os.path.join(ROOT_DIR, 'addons/official/view/web/official_common/pc/footer.html') with open(self.footer_path, 'r', encoding='utf-8') as f: self.footer_html = f.read() ai_buzzwords = [ '准备好与资深技术架构师展开深度研讨了吗', # 翻译腔 '认知智能化”跃迁', # 虚浮AI词 '数字见证力量', # 泛化套话 '开启确定性数字化未来', # 泛化套话 '让您的企业也拥有经得起考验的', # AI祈使句 '开启您的企业数字化与智能化升级项目', # 泛化套话 '开启确定性数字化技术合作', # 虚词 '严谨商务 · 现代中式 · 高级感专业软件服务', # 泄露的设计Prompt '现代中式 · 高级感' ] all_html = ( self.index_html + "\n" + self.services_html + "\n" + self.products_html + "\n" + self.cases_html + "\n" + self.about_html + "\n" + self.contact_html + "\n" + self.footer_html ) for buzzword in ai_buzzwords: self.assertNotIn(buzzword, all_html, f"全站必须彻底剔除 AI 通用套话/提示词残留: '{buzzword}'") def test_require_pragmatic_engineering_copy(self): """必须包含具体务实的工程化、场景化语言""" # 首页务实表达 self.assertIn('扎实的软件工程实践', self.index_html, "首页服务板块标题必须务实直接") self.assertIn('四大成熟商用系统', self.index_html, "首页产品板块标题必须清晰明确") self.assertIn('用生产环境数据说话', self.index_html, "首页案例板块必须务实接地气") self.assertIn('受控的软件研发流程', self.index_html, "首页流程板块标题必须强调受控确定性") self.assertIn('来自甲方的真实反馈', self.index_html, "首页评价板块标题必须务实") self.assertIn('有具体的系统研发或产品选型需求?我们来落实', self.index_html, "首页CTA必须说人话、重落实") # 服务页务实表达 self.assertIn('带着您的系统需求或技术难题,直接与架构师沟通', self.services_html, "服务页CTA必须杜绝翻译腔") # 案例页务实表达 self.assertIn('累计交付数据 · 用上线运行指标说话', self.cases_html, "案例页指标墙标题必须务实") self.assertIn('面临类似的业务系统瓶颈?我们可以提供针对性方案', self.cases_html, "案例页CTA必须直面业务痛点") # 关于我们与联系我们 self.assertIn('找懂业务、讲规范的研发团队,让软件项目平稳落地', self.about_html, "关于我们CTA必须务实接地气") self.assertIn('业务咨询与技术评估', self.contact_html, "联系我们标题必须清晰务实") if __name__ == '__main__': unittest.main()