:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(posthog-ai): run system prompt tests without a database (#116032)
posthog[bot]fc8f7d4c7439
diff --git a/products/posthog_ai/backend/tests/test_system_prompt.py b/products/posthog_ai/backend/tests/test_system_prompt.pyindex 955ccf0ad9d7..2b0f046bf9b1 100644--- a/products/posthog_ai/backend/tests/test_system_prompt.py+++ b/products/posthog_ai/backend/tests/test_system_prompt.py@@ -1,12 +1,14 @@-from posthog.test.base import APIBaseTest+from django.test import SimpleTestCase++from posthog.models import Team, Userfrom products.posthog_ai.backend.services.system_prompt.prompt import POSTHOG_AI_SYSTEM_PROMPTfrom products.posthog_ai.backend.services.system_prompt.service import ClaudeCodeSystemPrompt, PromptService-class TestPostHogAISystemPrompt(APIBaseTest):+class TestPostHogAISystemPrompt(SimpleTestCase):def _build(self) -> ClaudeCodeSystemPrompt:- return PromptService(self.team, self.user).build()+ return PromptService(Team(id=1), User(id=1)).build()def test_build_returns_preset_append_suffix(self):# The object form makes the agent-server append to Claude Code's prompt (a suffix), rather