mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 05:25:26 +02:00
feat: Cross-Household Recipes (#4089)
This commit is contained in:
parent
7ef2e91ecf
commit
9acf9ec27c
16 changed files with 545 additions and 92 deletions
|
@ -124,3 +124,20 @@ def test_admin_can_delete(
|
|||
response = api_client.get(api_routes.comments_item_id(comment_id), headers=admin_user.token)
|
||||
|
||||
assert response.status_code == 404
|
||||
|
||||
|
||||
def test_user_can_comment_on_other_household(api_client: TestClient, unique_recipe: Recipe, h2_user: TestUser):
|
||||
# Create Comment
|
||||
create_data = random_comment(unique_recipe.id)
|
||||
response = api_client.post(api_routes.comments, json=create_data, headers=h2_user.token)
|
||||
assert response.status_code == 201
|
||||
|
||||
# Delete Comment
|
||||
comment_id = response.json()["id"]
|
||||
response = api_client.delete(api_routes.comments_item_id(comment_id), headers=h2_user.token)
|
||||
assert response.status_code == 200
|
||||
|
||||
# Validate Deletion
|
||||
response = api_client.get(api_routes.comments_item_id(comment_id), headers=h2_user.token)
|
||||
|
||||
assert response.status_code == 404
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue