migrating ingredients

This commit is contained in:
vabene1111
2020-02-16 23:12:16 +01:00
parent 81677a74bb
commit f77aa7c8f0
12 changed files with 142 additions and 18 deletions

View File

@ -3,7 +3,7 @@ from django.contrib.auth.models import User
from django.test import TestCase, Client
from django.urls import reverse
from cookbook.models import Recipe, RecipeIngredients
from cookbook.models import Recipe, RecipeIngredient
class TestViews(TestCase):
@ -69,4 +69,4 @@ class TestViews(TestCase):
r = self.client.post(url,
{'name': 'Changed', 'working_time': 15, 'waiting_time': 15, 'ingredients': '[{"name":"Tomato","unit__name":"g","amount":100,"delete":false},{"name":"Egg","unit__name":"Piece","amount":2,"delete":false}]'})
self.assertEqual(r.status_code, 200)
self.assertEqual(2, RecipeIngredients.objects.filter(recipe=recipe).count())
self.assertEqual(2, RecipeIngredient.objects.filter(recipe=recipe).count())