mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
405 method not allowed for GET to POST endpoints, closes #1916
This commit is contained in:
parent
5518397338
commit
8404b21556
2 changed files with 26 additions and 1 deletions
|
|
@ -922,3 +922,26 @@ async def test_create_table(ds_write, input, expected_status, expected_response)
|
|||
assert response.status_code == expected_status
|
||||
data = response.json()
|
||||
assert data == expected_response
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize(
|
||||
"path",
|
||||
(
|
||||
"/data/-/create",
|
||||
"/data/docs/-/drop",
|
||||
"/data/docs/-/insert",
|
||||
),
|
||||
)
|
||||
async def test_method_not_allowed(ds_write, path):
|
||||
response = await ds_write.client.get(
|
||||
path,
|
||||
headers={
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
)
|
||||
assert response.status_code == 405
|
||||
assert response.json() == {
|
||||
"ok": False,
|
||||
"error": "Method not allowed",
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue