before gemiin

This commit is contained in:
2026-02-22 22:18:32 +01:00
parent fb33540bb0
commit 9db5cbf236
147 changed files with 7948 additions and 531 deletions

View File

@@ -12,6 +12,16 @@ def test_list_plants(client):
assert len(r.json()) == 2
def test_allow_same_common_name_with_different_varieties(client):
client.post("/api/plants", json={"nom_commun": "Tomate", "variete": "Roma"})
client.post("/api/plants", json={"nom_commun": "Tomate", "variete": "Andine Cornue"})
r = client.get("/api/plants")
assert r.status_code == 200
tomates = [p for p in r.json() if p["nom_commun"] == "Tomate"]
assert len(tomates) == 2
assert {p.get("variete") for p in tomates} == {"Roma", "Andine Cornue"}
def test_get_plant(client):
r = client.post("/api/plants", json={"nom_commun": "Basilic"})
id = r.json()["id"]