From f18189e48659c4ca9231aaf607aafc8f23c13d50 Mon Sep 17 00:00:00 2001 From: romeonicholas Date: Tue, 14 Nov 2023 11:32:42 +0100 Subject: [PATCH] test: Add test to patch model display order --- .../toolmodels/test_toolmodel_routes.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/backend/tests/projects/toolmodels/test_toolmodel_routes.py b/backend/tests/projects/toolmodels/test_toolmodel_routes.py index b5e9fc6a55..7e8c9f28ce 100644 --- a/backend/tests/projects/toolmodels/test_toolmodel_routes.py +++ b/backend/tests/projects/toolmodels/test_toolmodel_routes.py @@ -86,3 +86,21 @@ def test_rename_toolmodel_where_name_already_exists( assert response.status_code == 409 assert "A model with a similar name already exists" in response.text mock_get_model_by_slugs.assert_called_once() + + +def test_update_toolmodel_order_successful( + capella_model: toolmodels_models.DatabaseCapellaModel, + project: projects_models.DatabaseProject, + client: testclient.TestClient, + executor_name: str, + db: orm.Session, +): + users_crud.create_user(db, executor_name, users_models.Role.ADMIN) + + response = client.patch( + f"/api/v1/projects/{project.slug}/models/{capella_model.slug}", + json={"display_order": 1}, + ) + + assert response.status_code == 200 + assert "1" in response.text