Skip to content

Commit

Permalink
test(back): add test on sort destination.label
Browse files Browse the repository at this point in the history
test changes apply to route get_import_list

Reviewed-by: andriac
  • Loading branch information
andriacap committed Jan 31, 2024
1 parent ceb0c8f commit ffd0243
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backend/geonature/tests/imports/test_imports_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,13 @@ def test_list_imports(self, imports_all, all_modules_destination, users):
]

assert all(imprt["id_destination"] in ids_destination for imprt in json_data["imports"])

def test_order_import_foreign(self, users, imports_all):
set_logged_user(self.client, users["user"])
response = self.client.get(url_for("import.get_import_list") + "?sort=destination.label")
assert response.status_code == 200, response.data
imports = response.get_json()["imports"]
for a, b in zip(imports[:1], imports[1:]):
assert (a["destination"] is None) or (
a["destination"]["code"] <= b["destination"]["code"]
)

0 comments on commit ffd0243

Please sign in to comment.