: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(auth): take the internal API auth secret tests off the database (#100025)
posthog[bot]67d920431ba6
diff --git a/posthog/test/test_internal_api_auth.py b/posthog/test/test_internal_api_auth.pyindex c45e09307c1c..0755f649eb52 100644--- a/posthog/test/test_internal_api_auth.py+++ b/posthog/test/test_internal_api_auth.py@@ -3,7 +3,7 @@ from types import SimpleNamespacefrom posthog.test.base import APIBaseTestfrom unittest.mock import MagicMock, patch-from django.test import RequestFactory, override_settings+from django.test import RequestFactory, SimpleTestCase, override_settingsfrom parameterized import parameterizedfrom rest_framework.exceptions import AuthenticationFailed@@ -13,9 +13,8 @@ from posthog.auth import InternalAPIAuthenticationfrom posthog.settings import LOCAL_DEV_INTERNAL_API_SECRET-class TestInternalAPIAuth(APIBaseTest):+class TestInternalAPIAuthWithoutDatabase(SimpleTestCase):def setUp(self):- super().setUp()self.factory = RequestFactory()self.authentication = InternalAPIAuthentication()@@ -95,6 +94,13 @@ class TestInternalAPIAuth(APIBaseTest):request = self.factory.get("/internal/endpoint")self.assertEqual(self.authentication.authenticate_header(request), "InternalApiSecret")++class TestInternalAPIAuth(APIBaseTest):+ def setUp(self):+ super().setUp()+ self.factory = RequestFactory()+ self.authentication = InternalAPIAuthentication()+@override_settings(INTERNAL_API_SECRET="test-secret-123")def test_sets_org_and_team_from_team_id_route_param(self):request = Request(