|
1 |
| -from datetime import datetime, timezone |
2 |
| - |
3 | 1 | from sentry.data_secrecy.data_secrecy_logic import should_allow_superuser_access
|
4 |
| -from sentry.data_secrecy.models.datasecrecywaiver import DataSecrecyWaiver |
5 | 2 | from sentry.organizations.services.organization import (
|
6 | 3 | RpcOrganization,
|
7 | 4 | RpcOrganizationMember,
|
8 | 5 | RpcUserOrganizationContext,
|
9 | 6 | )
|
10 |
| -from sentry.silo.base import SiloMode |
11 | 7 | from sentry.testutils.cases import TestCase
|
12 |
| -from sentry.testutils.helpers import with_feature |
13 |
| -from sentry.testutils.helpers.datetime import freeze_time |
14 |
| -from sentry.testutils.silo import all_silo_test, assume_test_silo_mode, create_test_regions |
| 8 | +from sentry.testutils.silo import all_silo_test, create_test_regions |
15 | 9 |
|
16 | 10 |
|
17 | 11 | @all_silo_test(regions=create_test_regions("us"))
|
@@ -46,35 +40,3 @@ def test_bit_flag_disabled(self):
|
46 | 40 | self.organization.flags.prevent_superuser_access = False
|
47 | 41 | assert should_allow_superuser_access(self.organization) is True
|
48 | 42 | assert should_allow_superuser_access(self.rpc_context) is True
|
49 |
| - |
50 |
| - @with_feature("organizations:data-secrecy") |
51 |
| - def test_no_waiver_exists(self): |
52 |
| - with self.settings(SENTRY_SELF_HOSTED=False): |
53 |
| - assert should_allow_superuser_access(self.organization) is False |
54 |
| - assert should_allow_superuser_access(self.rpc_context) is False |
55 |
| - |
56 |
| - @freeze_time(datetime(2024, 7, 18, 0, 0, 0, tzinfo=timezone.utc)) |
57 |
| - @with_feature("organizations:data-secrecy") |
58 |
| - def test_waiver_expired(self): |
59 |
| - with assume_test_silo_mode(SiloMode.REGION): |
60 |
| - DataSecrecyWaiver.objects.create( |
61 |
| - organization=self.organization, |
62 |
| - access_start=datetime(2024, 7, 17, 0, 0, 0, tzinfo=timezone.utc), |
63 |
| - access_end=datetime(2024, 7, 17, 23, 59, 59, tzinfo=timezone.utc), |
64 |
| - ) |
65 |
| - with self.settings(SENTRY_SELF_HOSTED=False): |
66 |
| - assert should_allow_superuser_access(self.organization) is False |
67 |
| - assert should_allow_superuser_access(self.rpc_context) is False |
68 |
| - |
69 |
| - @freeze_time(datetime(2024, 7, 18, 0, 0, 0, tzinfo=timezone.utc)) |
70 |
| - @with_feature("organizations:data-secrecy") |
71 |
| - def test_waiver_active(self): |
72 |
| - with assume_test_silo_mode(SiloMode.REGION): |
73 |
| - DataSecrecyWaiver.objects.create( |
74 |
| - organization=self.organization, |
75 |
| - access_start=datetime(2024, 7, 18, 0, 0, 0, tzinfo=timezone.utc), |
76 |
| - access_end=datetime(2024, 7, 19, 0, 0, 0, tzinfo=timezone.utc), |
77 |
| - ) |
78 |
| - with self.settings(SENTRY_SELF_HOSTED=False): |
79 |
| - assert should_allow_superuser_access(self.organization) is True |
80 |
| - assert should_allow_superuser_access(self.rpc_context) is True |
0 commit comments