mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
RecipeFactory and all related models
This commit is contained in:
@@ -470,8 +470,8 @@ def test_tree_filter(obj_tree_1, obj_2, obj_3, u1_s1):
|
||||
|
||||
# This is more about the model than the API - should this be moved to a different test?
|
||||
@pytest.mark.parametrize("obj_tree_1, field, inherit, new_val", [
|
||||
({'add_categories': True, 'inherit': True}, 'supermarket_category', True, 'cat_1'),
|
||||
({'add_categories': True, 'inherit': False}, 'supermarket_category', False, 'cat_1'),
|
||||
({'has_category': True, 'inherit': True}, 'supermarket_category', True, 'cat_1'),
|
||||
({'has_category': True, 'inherit': False}, 'supermarket_category', False, 'cat_1'),
|
||||
({'ignore_shopping': True, 'inherit': True}, 'ignore_shopping', True, 'false'),
|
||||
({'ignore_shopping': True, 'inherit': False}, 'ignore_shopping', False, 'false'),
|
||||
], indirect=['obj_tree_1']) # indirect=True populates magic variable request.param of obj_tree_1 with the parameter
|
||||
@@ -499,7 +499,7 @@ def test_inherit(request, obj_tree_1, field, inherit, new_val, u1_s1):
|
||||
|
||||
# This is more about the model than the API - should this be moved to a different test?
|
||||
@pytest.mark.parametrize("obj_tree_1, field, inherit, new_val", [
|
||||
({'add_categories': True, 'inherit': True, }, 'supermarket_category', True, 'cat_1'),
|
||||
({'has_category': True, 'inherit': True, }, 'supermarket_category', True, 'cat_1'),
|
||||
({'ignore_shopping': True, 'inherit': True, }, 'ignore_shopping', True, 'false'),
|
||||
], indirect=['obj_tree_1']) # indirect=True populates magic variable request.param of obj_tree_1 with the parameter
|
||||
def test_ignoreinherit_field(request, obj_tree_1, field, inherit, new_val, u1_s1):
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.forms import model_to_dict
|
||||
from django.urls import reverse
|
||||
from django_scopes import scopes_disabled
|
||||
|
||||
from cookbook.models import ShoppingList, ShoppingListEntry, Food
|
||||
from cookbook.models import Food, ShoppingList, ShoppingListEntry
|
||||
|
||||
LIST_URL = 'api:shoppinglistentry-list'
|
||||
DETAIL_URL = 'api:shoppinglistentry-detail'
|
||||
@@ -129,3 +129,6 @@ def test_delete(u1_s1, u1_s2, obj_1):
|
||||
# TODO test create shopping list from recipe, excluding ingredients
|
||||
# TODO test auto creating shopping list from meal plan
|
||||
# TODO test excluding on-hand when auto creating shopping list
|
||||
# test delay
|
||||
# test completed_at when checked
|
||||
# test completed_at cleared when unchecked
|
||||
|
||||
Reference in New Issue
Block a user