diff --git a/tests/unit/views/preview_image_test.py b/tests/unit/views/preview_image_test.py index 225dcd642..f9492bf5f 100644 --- a/tests/unit/views/preview_image_test.py +++ b/tests/unit/views/preview_image_test.py @@ -1,6 +1,5 @@ -import io - import pytest +from io import BytesIO from magic import from_buffer from PIL import Image @@ -15,11 +14,9 @@ def test_preview_image_jobs(project_expo2011) -> None: @pytest.mark.usefixtures('project_expo2011', 'all_fixtures') -def test_preview_image_size(project_expo2011) -> None: +def test_preview_image_size_mimeytpe(project_expo2011) -> None: render_project_preview_image(project_id=project_expo2011.id) - with Image.open(io.BytesIO(project_expo2011.preview_image)) as preview_image: + with Image.open(BytesIO(project_expo2011.preview_image)) as preview_image: assert preview_image.size == (1280, 720) - image_mimetype = from_buffer( - io.BytesIO(project_expo2011.preview_image).read(2048), mime=True - ) + image_mimetype = from_buffer(BytesIO(project_expo2011.preview_image).read(2048), mime=True) assert image_mimetype == 'image/png'