From bfec7b7a6d97bf15d3072ab1ac471fac2301548f Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 2 Aug 2022 08:48:08 +0200 Subject: [PATCH] renomme /billets_absence/add en /billets_absence/create --- app/api/billets_absences.py | 6 +++--- tests/api/test_api_billets.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/api/billets_absences.py b/app/api/billets_absences.py index 83d861bc3..bc35b870a 100644 --- a/app/api/billets_absences.py +++ b/app/api/billets_absences.py @@ -33,12 +33,12 @@ def billets_absence_etudiant(etudid: int): return jsonify([billet.to_dict() for billet in billets]) -@bp.route("/billets_absence/add", methods=["POST"]) -@api_web_bp.route("/billets_absence/add", methods=["POST"]) +@bp.route("/billets_absence/create", methods=["POST"]) +@api_web_bp.route("/billets_absence/create", methods=["POST"]) @login_required @scodoc @permission_required(Permission.ScoAbsAddBillet) -def billets_absence_add(): +def billets_absence_create(): """Ajout d'un billet d'absence""" data = request.get_json(force=True) # may raise 400 Bad Request etudid = data.get("etudid") diff --git a/tests/api/test_api_billets.py b/tests/api/test_api_billets.py index d00094126..389b336ef 100644 --- a/tests/api/test_api_billets.py +++ b/tests/api/test_api_billets.py @@ -18,7 +18,7 @@ def test_billets(api_headers): Ajout, Liste, Suppression billets absences Routes : - - /billets_absence/add + - /billets_absence/create - /billets_absence/etudiant/[?format=xml|json] - /billets_absence/delete """ @@ -28,7 +28,7 @@ def test_billets(api_headers): abs_end="2022-08-01", description="test 1", ) - billet_r = POST_JSON("/billets_absence/add", billet_d, headers=api_headers) + billet_r = POST_JSON("/billets_absence/create", billet_d, headers=api_headers) assert billet_r["etudid"] == billet_d["etudid"] assert datetime.datetime.fromisoformat(billet_r["abs_begin"]).replace( tzinfo=None @@ -43,7 +43,7 @@ def test_billets(api_headers): abs_end="2022-08-03", description="test 2", ) - billet_r = POST_JSON("/billets_absence/add", billet_d2, headers=api_headers) + billet_r = POST_JSON("/billets_absence/create", billet_d2, headers=api_headers) billets = GET("/billets_absence/etudiant/1", headers=api_headers) assert len(billets) == 2 # Suppression