修复 /contact 404:新增 ContactPage 模型 + 线索表单区块

- 新增 apps.core.ContactPage(SEOablePage),复用 COMMON_BLOCKS StreamField,
  挂载于 HomePage 下;同步补充 HomePage.subpage_types 使后台可创建该子页面。
- 新增迁移 apps/core/migrations/0003_contactpage.py。
- 新增幂等管理命令 seed_contact_page:创建"联系我们"线索表单定义
  (姓名/公司/电话/邮箱/需求描述)+ 创建/更新 slug=contact 的页面,
  接入 bootstrap_deployment 部署引导流程。
- apps/home/tests.py 补充 ContactPage 相关回归测试(subpage_types 集合、
  管理后台可创建性参数化用例),全仓库 pytest 65 -> 68 全部通过。
- 设计文档 §2.16 进度清单同步更新。
This commit is contained in:
2026-09-23 10:24:38 +08:00
parent 18dcc4b584
commit eab27b3454
7 changed files with 148 additions and 2 deletions
+3 -1
View File
@@ -9,7 +9,7 @@ import pytest
from apps.blog.models import BlogIndexPage
from apps.cases.models import CaseStudyIndexPage
from apps.core.models import SimpleContentPage
from apps.core.models import ContactPage, SimpleContentPage
from apps.home.models import HomePage
from apps.products.models import ProductIndexPage
from apps.solutions.models import SolutionIndexPage
@@ -24,6 +24,7 @@ def test_home_page_subpage_types_allows_all_top_level_sections():
"solutions.SolutionIndexPage",
"cases.CaseStudyIndexPage",
"core.SimpleContentPage",
"core.ContactPage",
}
assert expected_types.issubset(set(HomePage.subpage_types))
@@ -37,6 +38,7 @@ def test_home_page_subpage_types_allows_all_top_level_sections():
(SolutionIndexPage, {"title": "解决方案", "slug": "solutions"}),
(CaseStudyIndexPage, {"title": "案例", "slug": "cases"}),
(SimpleContentPage, {"title": "隐私政策", "slug": "privacy-policy"}),
(ContactPage, {"title": "联系我们", "slug": "contact"}),
],
)
def test_each_top_level_section_can_be_created_under_home_in_admin(