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.

fix(test): Fix billing test permissions (#61912)

mendral-app[bot]80d2c0783c01
diff --git a/ee/api/test/test_billing.py b/ee/api/test/test_billing.py
index 392c3ebc9c01..72c0b44a73c6 100644
--- a/ee/api/test/test_billing.py
+++ b/ee/api/test/test_billing.py
@@ -580,6 +580,8 @@ class TestBillingAPI(APILicensedTest):
@patch("ee.api.billing.requests.get")
def test_billing_stores_valid_license(self, mock_request):
+ self.organization_membership.level = OrganizationMembership.Level.ADMIN
+ self.organization_membership.save()
self.license.delete()
mock_request.return_value.status_code = 200
@@ -604,6 +606,8 @@ class TestBillingAPI(APILicensedTest):
@patch("ee.api.billing.requests.get")
def test_billing_ignores_invalid_license(self, mock_request):
+ self.organization_membership.level = OrganizationMembership.Level.ADMIN
+ self.organization_membership.save()
self.license.delete()
mock_request.return_value.status_code = 403