MCPcopy
hub / github.com/pallets/flask / test_update

Function test_update

examples/tutorial/tests/test_blog.py:57–65  ·  view source on GitHub ↗
(client, auth, app)

Source from the content-addressed store, hash-verified

55
56
57def test_update(client, auth, app):
58 auth.login()
59 assert client.get("/1/update").status_code == 200
60 client.post("/1/update", data={"title": "updated", "body": ""})
61
62 with app.app_context():
63 db = get_db()
64 post = db.execute("SELECT * FROM post WHERE id = 1").fetchone()
65 assert post["title"] == "updated"
66
67
68@pytest.mark.parametrize("path", ("/create", "/1/update"))

Callers

nothing calls this directly

Calls 5

get_dbFunction · 0.90
loginMethod · 0.80
app_contextMethod · 0.80
getMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected