From 72c9dca8f2ed100aee58c2cc4835a2ee4ad5302a Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 22 Apr 2024 09:32:15 -0400 Subject: [PATCH] Fix a DeprecationWarning from aiohttp in TestPetPhotoView MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The warning says, “In v4, passing bytes will no longer create a file field. Please explicitly use the filename parameter or pass a BytesIO object.” This commit implements the latter approach. --- tests/integration/contrib/aiohttp/test_aiohttp_project.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/contrib/aiohttp/test_aiohttp_project.py b/tests/integration/contrib/aiohttp/test_aiohttp_project.py index 9b67705a..54f7297d 100644 --- a/tests/integration/contrib/aiohttp/test_aiohttp_project.py +++ b/tests/integration/contrib/aiohttp/test_aiohttp_project.py @@ -1,6 +1,7 @@ import os import sys from base64 import b64encode +from io import BytesIO import pytest @@ -63,7 +64,7 @@ async def test_post_valid(self, client, data_gif): "Host": "petstore.swagger.io", } data = { - "file": data_gif, + "file": BytesIO(data_gif), } cookies = {"user": "1"} pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy