Skip to content

Commit

Permalink
ref: delete dead test (#73202)
Browse files Browse the repository at this point in the history
<!-- Describe your PR here. -->
  • Loading branch information
asottile-sentry authored Jun 24, 2024
1 parent 8cd9de2 commit 342c779
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 44 deletions.
24 changes: 1 addition & 23 deletions tests/sentry/web/frontend/test_sentryapp_avatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,13 @@

from sentry.models.avatars.sentry_app_avatar import SentryAppAvatar
from sentry.models.files.control_file import ControlFile
from sentry.models.files.file import File
from sentry.silo.base import SiloMode
from sentry.testutils.cases import APITestCase
from sentry.testutils.silo import assume_test_silo_mode, control_silo_test
from sentry.testutils.silo import control_silo_test
from sentry.web.frontend.generic import FOREVER_CACHE


@control_silo_test
class SentryAppAvatarTest(APITestCase):
def test_headers(self):
# We cannot read File from Control silo
if SiloMode.get_current_mode() == SiloMode.CONTROL:
return

sentry_app = self.create_sentry_app(name="Meow", organization=self.organization)
with assume_test_silo_mode(SiloMode.REGION):
photo = File.objects.create(name="test.png", type="avatar.file")
photo.putfile(BytesIO(b"test"))
avatar = SentryAppAvatar.objects.create(
sentry_app=sentry_app, avatar_type=1, color=True, file_id=photo.id
)
url = reverse("sentry-app-avatar-url", kwargs={"avatar_id": avatar.ident})
response = self.client.get(url)
assert response.status_code == 200
assert response["Cache-Control"] == FOREVER_CACHE
assert response.get("Vary") == "Accept-Language, Cookie"
assert response.get("Set-Cookie") is None
assert response["Access-Control-Allow-Origin"]

def test_headers_control_file(self):
sentry_app = self.create_sentry_app(name="Meow", organization=self.organization)
photo = ControlFile.objects.create(name="test.png", type="avatar.file")
Expand Down
22 changes: 1 addition & 21 deletions tests/sentry/web/frontend/test_user_avatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,13 @@

from sentry.models.avatars.user_avatar import UserAvatar
from sentry.models.files.control_file import ControlFile
from sentry.models.files.file import File
from sentry.silo.base import SiloMode
from sentry.testutils.cases import TestCase
from sentry.testutils.silo import assume_test_silo_mode, control_silo_test
from sentry.testutils.silo import control_silo_test
from sentry.web.frontend.generic import FOREVER_CACHE


@control_silo_test
class UserAvatarTest(TestCase):
def test_headers(self):
# We cannot read File from Control silo
if SiloMode.get_current_mode() == SiloMode.CONTROL:
return

user = self.create_user(email="[email protected]")
with assume_test_silo_mode(SiloMode.REGION):
photo = File.objects.create(name="test.png", type="avatar.file")
photo.putfile(BytesIO(b"test"))
avatar = UserAvatar.objects.create(user=user, file_id=photo.id)
url = reverse("sentry-user-avatar-url", kwargs={"avatar_id": avatar.ident})
response = self.client.get(url)
assert response.status_code == 200
assert response["Cache-Control"] == FOREVER_CACHE
assert response.get("Vary") is None
assert response.get("Set-Cookie") is None
assert response["Access-Control-Allow-Origin"]

def test_headers_control_file(self):
user = self.create_user(email="[email protected]")
photo = ControlFile.objects.create(name="test.png", type="avatar.file")
Expand Down

0 comments on commit 342c779

Please sign in to comment.