1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-02 20:15:24 +02:00

Feature/auto increment recipe name (#1088)

* auto-increment-recipe-name

* add test-case

* re-implement as try/except
This commit is contained in:
Hayden 2022-03-23 17:23:40 -08:00 committed by GitHub
parent 0f82523cdd
commit 7f102f513d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 2 deletions

View file

@ -62,9 +62,10 @@ def test_unique_slug_by_group(api_client: TestClient, unique_user: TestUser, g2_
response = api_client.post(Routes.base, json=create_data, headers=g2_user.token)
assert response.status_code == 201
# Try to create a recipe again with the same name
# Try to create a recipe again with the same name and check that the name was incremented
response = api_client.post(Routes.base, json=create_data, headers=g2_user.token)
assert response.status_code == 400
assert response.status_code == 201
assert response.json() == create_data["name"] + "-1"
def test_user_locked_recipe(api_client: TestClient, user_tuple: list[TestUser]) -> None: