added test for cook log

This commit is contained in:
vabene1111
2021-03-10 21:25:18 +01:00
parent 528f329ebb
commit e7f8d58a7d
6 changed files with 166 additions and 19 deletions

View File

@@ -3,10 +3,11 @@ import inspect
import uuid
import pytest
from django.contrib import auth
from django.contrib.auth.models import User, Group
from django_scopes import scopes_disabled
from cookbook.models import Space
from cookbook.models import Space, Recipe
# hack from https://github.com/raphaelm/django-scopes to disable scopes for all fixtures
@@ -37,6 +38,20 @@ def space_2():
return Space.objects.get_or_create(name='space_2')[0]
# ---------------------- OBJECT FIXTURES ---------------------
@pytest.fixture()
def recipe_1_s1(space_1, u1_s1):
return Recipe.objects.create(
name='recipe_1_s1',
waiting_time=20,
working_time=20,
servings=4,
created_by=auth.get_user(u1_s1),
space=space_1
)
# ---------------------- USER FIXTURES -----------------------
# maybe better with factories but this is very explict so ...