Skip to content

: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.

chore(tests): avoid database setup in AI agent tests (part 3) (#116228)

Paul D'Ambra67211fd8bce8
diff --git a/ee/hogai/utils/test/test_dispatcher.py b/ee/hogai/utils/test/test_dispatcher.py
index 86cad63f5a9f..0713f3e767a1 100644
--- a/ee/hogai/utils/test/test_dispatcher.py
+++ b/ee/hogai/utils/test/test_dispatcher.py
@@ -7,6 +7,8 @@ Tests the dispatcher logic that emits actions to LangGraph custom stream.
from posthog.test.base import BaseTest
from unittest.mock import MagicMock, patch
+from django.test import SimpleTestCase
+
from langchain_core.runnables import RunnableConfig
from posthog.schema import AssistantMessage, AssistantToolCall
@@ -359,7 +361,7 @@ class TestCreateDispatcherFromConfig(BaseTest):
self.assertEqual(len(dispatcher._node_path), 3)
-class TestDispatcherIntegration(BaseTest):
+class TestDispatcherIntegration(SimpleTestCase):
"""Integration tests for dispatcher usage patterns."""
def test_dispatcher_in_node_context(self):
diff --git a/ee/hogai/utils/test/test_openai.py b/ee/hogai/utils/test/test_openai.py
index df849b23e6fd..bd0817837e9f 100644
--- a/ee/hogai/utils/test/test_openai.py
+++ b/ee/hogai/utils/test/test_openai.py
@@ -1,11 +1,11 @@
-from posthog.test.base import BaseTest
+from django.test import SimpleTestCase
from posthog.schema import AssistantMessage, AssistantToolCallMessage, ContextMessage, FailureMessage, HumanMessage
from ee.hogai.utils.openai import convert_to_openai_message, convert_to_openai_messages
-class TestOpenAIUtils(BaseTest):
+class TestOpenAIUtils(SimpleTestCase):
def test_convert_context_message_to_openai_message(self):
message = ContextMessage(content="Context information")
diff --git a/posthog/test/repo_invariants/database_free_test_classes_baseline.txt b/posthog/test/repo_invariants/database_free_test_classes_baseline.txt
index 83f97b8804bb..2bbb9ebc1b94 100644
--- a/posthog/test/repo_invariants/database_free_test_classes_baseline.txt
+++ b/posthog/test/repo_invariants/database_free_test_classes_baseline.txt
@@ -2,8 +2,6 @@ ee/api/vercel/test/test_vercel_connect.py::TestValidateNextUrl
ee/clickhouse/materialized_columns/test/test_analyze.py::TestMaterializedColumnsAnalyze
ee/clickhouse/models/test/test_dead_letter_queue.py::TestDeadLetterQueue
ee/clickhouse/models/test/test_property.py::TestPropDenormalized
-ee/hogai/utils/test/test_dispatcher.py::TestDispatcherIntegration
-ee/hogai/utils/test/test_openai.py::TestOpenAIUtils
ee/partners/stripe/api/provisioning/test/test_services_catalog.py::TestServicesCatalog
posthog/admin/test_admin.py::TestOAuthSidebarRegrouping
posthog/admin/test_admin.py::TestOrganizationMemberInlineConfig