diff --git a/kipina-codebench/prompts/code-small.md b/kipina-codebench/prompts/code-small.md index f606599..9c32b29 100644 --- a/kipina-codebench/prompts/code-small.md +++ b/kipina-codebench/prompts/code-small.md @@ -35,12 +35,18 @@ class Post(Base): author_id: Mapped[int] = mapped_column(ForeignKey("authors.id")) ``` -Example FK test pattern: +Example FK test patterns: ``` def test_create_post(): author = client.post("/authors/", json={"name": "Kirjailija"}).json() response = client.post("/posts/", json={"title": "Artikkeli", "author_id": author["id"]}) assert response.status_code == 201 + +def test_update_post(): + author = client.post("/authors/", json={"name": "Päivittäjä"}).json() + created = client.post("/posts/", json={"title": "Vanha", "author_id": author["id"]}).json() + response = client.put(f"/posts/{created['id']}", json={"title": "Uusi", "author_id": author["id"]}) + assert response.status_code == 201 ``` CRITICAL: