avant codex
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
def test_create_planting(client):
|
||||
g = client.post("/api/gardens", json={"nom": "Potager", "type": "plein_air"}).json()
|
||||
v = client.post("/api/varieties", json={"nom_commun": "Tomate"}).json()
|
||||
v = client.post("/api/plants", json={"nom_commun": "Tomate"}).json()
|
||||
r = client.post("/api/plantings", json={
|
||||
"garden_id": g["id"], "variety_id": v["id"], "quantite": 3
|
||||
})
|
||||
@@ -10,7 +10,7 @@ def test_create_planting(client):
|
||||
|
||||
def test_list_plantings(client):
|
||||
g = client.post("/api/gardens", json={"nom": "Potager", "type": "plein_air"}).json()
|
||||
v = client.post("/api/varieties", json={"nom_commun": "Tomate"}).json()
|
||||
v = client.post("/api/plants", json={"nom_commun": "Tomate"}).json()
|
||||
client.post("/api/plantings", json={"garden_id": g["id"], "variety_id": v["id"]})
|
||||
r = client.get("/api/plantings")
|
||||
assert r.status_code == 200
|
||||
@@ -19,7 +19,7 @@ def test_list_plantings(client):
|
||||
|
||||
def test_add_planting_event(client):
|
||||
g = client.post("/api/gardens", json={"nom": "Potager", "type": "plein_air"}).json()
|
||||
v = client.post("/api/varieties", json={"nom_commun": "Tomate"}).json()
|
||||
v = client.post("/api/plants", json={"nom_commun": "Tomate"}).json()
|
||||
p = client.post("/api/plantings", json={"garden_id": g["id"], "variety_id": v["id"]}).json()
|
||||
r = client.post(f"/api/plantings/{p['id']}/events", json={"type": "arrosage", "note": "Bien arrosé"})
|
||||
assert r.status_code == 201
|
||||
|
||||
Reference in New Issue
Block a user