feat(footer): 展示网站 ICP 备案信息

This commit is contained in:
admin committed 2026-09-21 18:13:34 +08:00
1 parent c220dcad7a
commit fb0cf30086
4 files changed
+26 -1

No files matched your search

+13
View File
@@ -80,6 +80,19 @@ class AuthTests(unittest.TestCase):
self.assertEqual(client.get("/api/reading/status").status_code, 401)
self.assertEqual(client.get("/api/v2/status").status_code, 401)
def test_home_footer_displays_icp_record_link(self):
with patch.dict(os.environ, {"WEREAD_SESSION_SECRET": "test-secret"}):
web_app = importlib.import_module("app").app
web_app.config.update(SECRET_KEY="test-secret", SESSION_COOKIE_SECURE=False)
client = web_app.test_client()
with client.session_transaction() as session:
session["auth_user"] = "reader"
response = client.get("/")
self.assertEqual(response.status_code, 200)
self.assertIn(b"https://beian.miit.gov.cn/", response.data)
self.assertIn("浙ICP备202607916号-1".encode(), response.data)
def test_first_account_requires_setup_token_and_is_stored_as_hash(self):
page = self.client.get("/login")
csrf = self.csrf(page)