File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,6 @@ async def __call__(
5353 break
5454
5555 if media_type .strip () != _get_vendor_media_type ():
56- error_response = JSONResponse (
57- {"detail" : "Wrong media type" },
58- status_code = 406 ,
59- )
6056 break
6157
6258 version = ""
Original file line number Diff line number Diff line change @@ -73,13 +73,13 @@ async def test_simple_router(test_client: TestClient) -> None:
7373 assert text == "Hello, world!"
7474
7575
76- async def test_bad_accept_header (test_client : TestClient ) -> None :
76+ async def test_bad_accept_header_default_response (test_client : TestClient ) -> None :
7777 response = test_client .get (
7878 "/test/" ,
7979 headers = {"Accept" : "application/vnd.wrong+json; version=1.0" },
8080 )
81- assert response .status_code == status .HTTP_406_NOT_ACCEPTABLE
82- assert response .json () == { "detail" : "Wrong media type" }
81+ assert response .status_code == status .HTTP_200_OK
82+ assert response .headers [ "content-type" ] == f" { VERSION_HEADER } ; version=1.0"
8383
8484
8585async def test_no_version (test_client : TestClient ) -> None :
You can’t perform that action at this time.
0 commit comments