Phase 3: T-301~T-304 SEO/部署/SQLite/统计/MVP验收完成(42 tests)

This commit is contained in:
ila
2026-07-06 23:32:57 +08:00
parent 6dd1711164
commit dcc626544c
9 changed files with 293 additions and 13 deletions
+13 -2
View File
@@ -1,4 +1,4 @@
from django.test import TestCase
from django.test import TestCase, override_settings
from django.db import IntegrityError
from django.core.exceptions import ValidationError
@@ -484,4 +484,15 @@ class SEOTests(PageTreeMixin, TestCase):
def test_sitemap_returns_200(self):
resp = self.client.get("/sitemap.xml")
self.assertEqual(resp.status_code, 200)
self.assertEqual(resp.status_code, 200)
@override_settings(PLAUSIBLE_DOMAIN="skelet.example.com")
def test_analytics_script_when_domain_set(self):
resp = self.client.get("/")
self.assertContains(resp, "plausible.io")
self.assertContains(resp, "skelet.example.com")
def test_external_link_click_tracking(self):
resp = self.client.get("/")
self.assertContains(resp, "Outbound Link")
self.assertContains(resp, "link.hostname")