Skip to content

Commit

Permalink
✅ Add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leeandher committed Jan 9, 2025
1 parent 9d6ea97 commit 129fccc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sentry/api/serializers/models/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ class DetailedOrganizationSerializerResponse(_DetailedOrganizationSerializerResp
metricsActivateLastForGauges: bool
requiresSso: bool
rollbackEnabled: bool
streamlineOnly: bool


class DetailedOrganizationSerializer(OrganizationSerializer):
Expand Down
15 changes: 15 additions & 0 deletions tests/sentry/api/endpoints/test_organization_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from sentry.silo.base import SiloMode
from sentry.slug.patterns import ORG_SLUG_PATTERN
from sentry.testutils.cases import APITestCase, TwoFactorAPITestCase
from sentry.testutils.helpers import override_options
from sentry.testutils.hybrid_cloud import HybridCloudTestMixin
from sentry.testutils.silo import assume_test_silo_mode, create_test_regions, region_silo_test
from sentry.users.models.authenticator import Authenticator
Expand Down Expand Up @@ -316,6 +317,20 @@ def test_data_consent(self):
assert org.name == data["name"]
assert OrganizationOption.objects.get_value(org, "sentry:aggregated_data_consent") is True

@override_options({"issues.details.streamline_rollout_rate": 1.0})
def test_streamline_only_is_true(self):
self.login_as(user=self.user)
response = self.get_success_response(name="acme")
organization = Organization.objects.get(id=response.data["id"])
assert OrganizationOption.objects.get_value(organization, "sentry:streamline_ui_only")

@override_options({"issues.details.streamline_rollout_rate": 0})
def test_streamline_only_is_false(self):
self.login_as(user=self.user)
response = self.get_success_response(name="acme")
organization = Organization.objects.get(id=response.data["id"])
assert not OrganizationOption.objects.get_value(organization, "sentry:streamline_ui_only")


@region_silo_test(regions=create_test_regions("de", "us"))
class OrganizationsCreateInRegionTest(OrganizationIndexTest, HybridCloudTestMixin):
Expand Down

0 comments on commit 129fccc

Please sign in to comment.