Skip to content

Commit

Permalink
Remove cor_nom_liste
Browse files Browse the repository at this point in the history
  • Loading branch information
amandine-sahl committed Aug 28, 2024
1 parent bbed1b4 commit bb3495c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
19 changes: 0 additions & 19 deletions apptax/taxonomie/routesbiblistes.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,3 @@ def get_biblistesbyTaxref(regne, group2_inpn):
q = q.where(BibListes.group2_inpn == group2_inpn)
results = q.all()
return BibListesSchema().dump(results, many=True)


@adresses.route("/cor_nom_liste", methods=["GET"])
@json_resp
def get_cor_nom_liste():
limit = request.args.get("limit", 20, int)
page = request.args.get("page", 1, int)
q = db.session.query(BibListes.id_liste, Taxref.cd_nom).join(BibListes.noms)
total = q.count()
results = q.paginate(page=page, per_page=limit, error_out=False)
items = []
for r in results.items:
items.append({"id_liste": r.id_liste, "cd_nom": r.cd_nom})
return {
"items": items,
"total": total,
"limit": limit,
"page": page,
}
9 changes: 0 additions & 9 deletions apptax/tests/test_biblistes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ class TestApiBibListe:
}
)

def test_cor_nom_liste(self, noms_example):
response = self.client.get(
url_for("bib_listes.get_cor_nom_liste"),
)
assert response.status_code == 200
data = response.json
assert len(data["items"]) > 0
self.schema_cor_nom_liste.validate(data)

schema_allnamebyListe = Schema(
[
{
Expand Down

0 comments on commit bb3495c

Please sign in to comment.