Make new recipes public by default
New recipes (manual, AI draft and all imports) now start as public; private can still be chosen per recipe. Existing recipes are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ffb4c0150a
commit
c76fd119cf
@@ -188,3 +188,19 @@ def test_user_cannot_bulk_delete(user_client, other_user):
|
||||
make_recipe(other_user)
|
||||
assert user_client.post(reverse("accounts:admin_user_delete_recipes", args=[other_user.pk])).status_code == 403
|
||||
assert Recipe.objects.exists()
|
||||
|
||||
|
||||
def test_new_recipe_form_defaults_to_public(user_client):
|
||||
form = user_client.get(reverse("recipes:create")).context["form"]
|
||||
assert form["visibility"].value() == "public"
|
||||
|
||||
|
||||
def test_imported_draft_defaults_to_public(user_client, settings):
|
||||
settings.OPENAI_API_KEY = ""
|
||||
response = user_client.post(reverse("recipes:import_text"), {"text": "200 g Mehl, 2 Eier, verrühren und backen"})
|
||||
assert response.context["form"]["visibility"].value() == "public"
|
||||
|
||||
|
||||
def test_private_can_still_be_chosen(user_client):
|
||||
user_client.post(reverse("recipes:create"), form_data(visibility="private"))
|
||||
assert Recipe.objects.get().visibility == "private"
|
||||
|
||||
Reference in New Issue
Block a user