mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Test illustrating POST against register_routes(), closes #853
This commit is contained in:
parent
a4ad5a504c
commit
d2aef9f7ef
2 changed files with 14 additions and 0 deletions
|
|
@ -568,6 +568,13 @@ def test_register_routes(app_client, path, body):
|
|||
assert body == response.text
|
||||
|
||||
|
||||
def test_register_routes_post(app_client):
|
||||
response = app_client.post("/post/", {"this is": "post data"}, csrftoken_from=True)
|
||||
assert 200 == response.status
|
||||
assert "csrftoken" in response.json
|
||||
assert "post data" == response.json["this is"]
|
||||
|
||||
|
||||
def test_register_routes_asgi(app_client):
|
||||
response = app_client.get("/three/")
|
||||
assert {"hello": "world"} == response.json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue