release: prepare Hulumath v1.2.0
CI / test (pull_request) Successful in 3m58s
PR合并自动部署 / release-check (pull_request) Successful in 13s
PR合并自动部署 / deploy (pull_request) Successful in 16s

This commit is contained in:
2026-08-10 01:23:30 +08:00
parent aafaf1b77a
commit 6c9f475ba5
14 changed files with 280 additions and 6 deletions
+10
View File
@@ -180,3 +180,13 @@ def test_math_life_使用独立界面印记面板且清理交叉点():
assert "function renderStoryMarks(run)" in app
assert "choice.special" in app
assert ".story-experience { position: fixed; inset: 0" in styles
def test_home_公众号入口可复制并跳转微信():
template = (settings.BASE_DIR / "templates" / "index.html").read_text(encoding="utf-8")
app = (STATIC_ROOT / "js" / "app.js").read_text(encoding="utf-8")
assert 'id="wechat-copy"' in template
assert 'href="weixin://"' in template
assert "function copyWechatName()" in app
assert 'navigator.clipboard.writeText(name)' in app
+25
View File
@@ -0,0 +1,25 @@
import pytest
from django.conf import settings
@pytest.mark.django_db
def test_health_包含当前发布版本(client):
response = client.get("/health/")
assert response.status_code == 200
assert response.json() == {
"status": "ok",
"database": "ok",
"version": settings.APP_VERSION,
}
def test_home_展示公众号入口与版本(client):
response = client.get("/")
content = response.content.decode()
assert response.status_code == 200
assert "公众号" in content
assert "葫芦数学" in content
assert f"Hulumath v{settings.APP_VERSION}" in content
assert 'href="weixin://"' in content
+9 -2
View File
@@ -1,14 +1,21 @@
from django.conf import settings
from django.db import connection
from django.http import JsonResponse
from django.shortcuts import render
def home(request):
return render(request, "index.html")
return render(request, "index.html", {"app_version": settings.APP_VERSION})
def health(request):
with connection.cursor() as cursor:
cursor.execute("SELECT 1")
cursor.fetchone()
return JsonResponse({"status": "ok", "database": "ok"})
return JsonResponse(
{
"status": "ok",
"database": "ok",
"version": settings.APP_VERSION,
}
)