22
33from django .urls import reverse
44
5- from sentry .objectstore import preprod
5+ from sentry .objectstore import get_preprod_session
66from sentry .testutils .cases import APITestCase
77from sentry .testutils .skips import requires_objectstore
88
@@ -30,7 +30,7 @@ def _get_url(self, image_id=None):
3030 def test_successful_image_retrieval_png (self ):
3131 png_data = b"\x89 PNG\r \n \x1a \n " + b"fake png content" * 100
3232
33- client = preprod . for_project (self .org .id , self .project .id )
33+ client = get_preprod_session (self .org .id , self .project .id )
3434 client .put (BytesIO (png_data ), id = f"{ self .org .id } /{ self .project .id } /test-image-123" )
3535
3636 url = self ._get_url ()
@@ -46,7 +46,7 @@ def test_successful_image_retrieval_png(self):
4646 def test_successful_image_retrieval_jpeg (self ):
4747 jpeg_data = b"\xff \xd8 \xff " + b"fake jpeg content" * 100
4848
49- client = preprod . for_project (self .org .id , self .project .id )
49+ client = get_preprod_session (self .org .id , self .project .id )
5050 client .put (BytesIO (jpeg_data ), id = f"{ self .org .id } /{ self .project .id } /test-image-123" )
5151
5252 url = self ._get_url ()
@@ -62,7 +62,7 @@ def test_successful_image_retrieval_jpeg(self):
6262 def test_successful_image_retrieval_webp (self ):
6363 webp_data = b"RIFF" + b"1234" + b"WEBP" + b"fake webp content" * 100
6464
65- client = preprod . for_project (self .org .id , self .project .id )
65+ client = get_preprod_session (self .org .id , self .project .id )
6666 client .put (BytesIO (webp_data ), id = f"{ self .org .id } /{ self .project .id } /test-image-123" )
6767
6868 url = self ._get_url ()
@@ -77,7 +77,7 @@ def test_successful_image_retrieval_webp(self):
7777 def test_successful_image_retrieval_heic (self ):
7878 heic_data = b"RIFF" + b"ftypheic" + b"fake heic content" * 100
7979
80- client = preprod . for_project (self .org .id , self .project .id )
80+ client = get_preprod_session (self .org .id , self .project .id )
8181 client .put (BytesIO (heic_data ), id = f"{ self .org .id } /{ self .project .id } /test-image-123" )
8282
8383 url = self ._get_url ()
@@ -103,7 +103,7 @@ def test_image_not_found(self):
103103 def test_unknown_image_format (self ):
104104 unknown_data = b"unknown binary data" * 50
105105
106- client = preprod . for_project (self .org .id , self .project .id )
106+ client = get_preprod_session (self .org .id , self .project .id )
107107 client .put (BytesIO (unknown_data ), id = f"{ self .org .id } /{ self .project .id } /test-image-123" )
108108
109109 url = self ._get_url ()
0 commit comments