From 2d6de99585396aad4ec704dfbe915910904d12bd Mon Sep 17 00:00:00 2001 From: vikynoah Date: Thu, 16 Jan 2025 09:35:23 +0100 Subject: [PATCH] fix: post_file method change for testing (#29) * fix: post_file method change for testing * changes --- creyPY/fastapi/testing.py | 2 +- creyPY/fastapi/testing_async.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/creyPY/fastapi/testing.py b/creyPY/fastapi/testing.py index 21194d1..bd8a53f 100644 --- a/creyPY/fastapi/testing.py +++ b/creyPY/fastapi/testing.py @@ -41,7 +41,7 @@ class GenericClient(TestClient): re = self.c.post( url, files={"file": file}, - headers=self.default_headers | {"Content-Type": "application/json"}, + headers=self.default_headers, *args, **kwargs, ) diff --git a/creyPY/fastapi/testing_async.py b/creyPY/fastapi/testing_async.py index 836e3f1..3e44c86 100644 --- a/creyPY/fastapi/testing_async.py +++ b/creyPY/fastapi/testing_async.py @@ -1,4 +1,5 @@ import json + from httpx import ASGITransport, AsyncClient @@ -45,7 +46,7 @@ class AsyncGenericClient: re = await self.c.post( url, files={"file": file}, - headers=self.default_headers | {"Content-Type": "application/json"}, + headers=self.default_headers, *args, **kwargs, )