File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ aiohttp-security==0.4.0
4
4
aiohttp-session [secure ]== 2.12.0
5
5
aiosqlite == 0.19.0
6
6
cryptography == 41.0.3
7
- pydantic == 2.1.1
7
+ pydantic == 2.2.0
8
8
pytest == 7.4.0
9
9
pytest-aiohttp == 1.0.4
10
10
pytest-cov == 4.1.0
Original file line number Diff line number Diff line change @@ -91,19 +91,14 @@ async def test_login_invalid_payload(admin_client: TestClient) -> None:
91
91
url = admin_client .app ["admin" ].router ["token" ].url_for ()
92
92
async with admin_client .post (url , json = {"foo" : "bar" , "password" : None }) as resp :
93
93
assert resp .status == 400
94
- assert await resp .json () == [{
95
- "loc" : ["username" ],
96
- "msg" : "Field required" ,
97
- "type" : "missing" ,
98
- "input" : {"foo" : "bar" , "password" : None },
99
- "url" : "https://errors.pydantic.dev/2.1/v/missing"
100
- }, {
101
- "loc" : ["password" ],
102
- "msg" : "Input should be a valid string" ,
103
- "type" : "string_type" ,
104
- "input" : None ,
105
- "url" : "https://errors.pydantic.dev/2.1/v/string_type"
106
- }]
94
+ result = await resp .json ()
95
+ assert len (result ) == 2
96
+ assert result [0 ]["loc" ] == ["username" ]
97
+ assert result [0 ]["msg" ] == "Field required"
98
+ assert result [0 ]["input" ] == {"foo" : "bar" , "password" : None }
99
+ assert result [1 ]["loc" ] == ["password" ]
100
+ assert result [1 ]["msg" ] == "Input should be a valid string"
101
+ assert result [1 ]["input" ] is None
107
102
108
103
109
104
async def test_list_without_permission (create_admin_client : _CreateClient , # type: ignore[no-any-unimported] # noqa: B950
You can’t perform that action at this time.
0 commit comments