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__(
53
53
break
54
54
55
55
if media_type .strip () != _get_vendor_media_type ():
56
- error_response = JSONResponse (
57
- {"detail" : "Wrong media type" },
58
- status_code = 406 ,
59
- )
60
56
break
61
57
62
58
version = ""
Original file line number Diff line number Diff line change @@ -73,13 +73,13 @@ async def test_simple_router(test_client: TestClient) -> None:
73
73
assert text == "Hello, world!"
74
74
75
75
76
- async def test_bad_accept_header (test_client : TestClient ) -> None :
76
+ async def test_bad_accept_header_default_response (test_client : TestClient ) -> None :
77
77
response = test_client .get (
78
78
"/test/" ,
79
79
headers = {"Accept" : "application/vnd.wrong+json; version=1.0" },
80
80
)
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"
83
83
84
84
85
85
async def test_no_version (test_client : TestClient ) -> None :
You can’t perform that action at this time.
0 commit comments