Skip to content

Commit

Permalink
test: Add test to patch model display order
Browse files Browse the repository at this point in the history
  • Loading branch information
romeonicholas committed Nov 14, 2023
1 parent c1ac186 commit f18189e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions backend/tests/projects/toolmodels/test_toolmodel_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f18189e

Please sign in to comment.