fixed spuce eats test

This commit is contained in:
smilerz 2022-05-11 14:18:14 -05:00
parent b3cc9967f5
commit 37e215a4ea
No known key found for this signature in database
GPG Key ID: 39444C7606D47126
4 changed files with 2681 additions and 1555 deletions

View File

@ -2226,237 +2226,238 @@ TASTE_OF_HOME = {
THE_SPRUCE_EATS = {
'file': ['thespruceeats.html'],
'url': 'https://www.thespruceeats.com/creamy-potato-soup-with-ham-3059797',
"name": "Creamy Potato Soup With Ham",
"description": "",
"servings": 6,
"prepTime": 55,
"cookTime": 0,
"image": 'https://www.thespruceeats.com/thmb/KfpdKXpq4JYKIIyv8ZuKuR8GRkQ=/960x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/creamy-potato-soup-with-ham-3059797-stovetop-step-12-99dc3bf1962c4e26a2d225ee3c25ecad.jpg',
"keywords": [],
"recipeIngredient": [
"servings_text": "servings",
"working_time": 20,
"waiting_time": 35,
"image": "https://www.thespruceeats.com/thmb/X_emapo3nNw6ASJctdNpYycYFtM=/940x0/filters:no_upscale():max_bytes(150000):strip_icc()/creamy-potato-soup-with-ham-3059797-stovetop-step-12-99dc3bf1962c4e26a2d225ee3c25ecad.jpg",
"source_url": "https://www.thespruceeats.com/creamy-potato-soup-with-ham-3059797",
"keywords": [
{
"label": "soup",
"name": "soup",
"id": 18,
},
{
"label": "lunch",
"name": "lunch",
},
{
"label": "entree",
"name": "entree",
},
{
"label": "side dish",
"name": "side dish",
"id": 14,
},
{
"label": "www.thespruceeats.com",
"name": "www.thespruceeats.com",
},
{
"label": "southern",
"name": "southern",
"id": 27,
},
{
"label": "cheddar",
"name": "cheddar",
},
{
"label": "dinner",
"name": "dinner",
}
],
"steps": [
{
"instruction": "Gather the ingredients. \nIn a large saucepan, melt butter over medium-low heat. \nAdd onion, celery, carrots, and ham. \nCook, stirring frequently until onions are tender, about 5 minutes. \nAdd the garlic and continue cooking for 1 to 2 minutes longer. \nAdd vegetable broth, water, and potatoes. \nCover and cook for about 25 minutes, until potatoes are tender. \nWhisk flour into the heavy cream until smooth. \nStir into the hot mixture. \nStir in the half-and-half or milk. Taste and add salt and pepper, as desired. Continue cooking until hot. \nUsing a potato masher or fork, mash the potatoes slightly to thicken; add more milk if the soup is too thick. \nServe the potato soup garnished with parsley, sliced green onions or chives, or a little bit of shredded cheese. \nGather the ingredients. \nIn a large saucepan, melt butter over medium-low heat. \nAdd onion, celery, carrots, and ham. \nCook, stirring frequently until onions are tender, about 5 minutes. \nAdd the garlic and continue cooking for 1 to 2 minutes longer. \nThen transfer the cooked vegetables to the slow cooker and add the broth, water, and potatoes. \nCover and cook on high for about 2 to 3 hours, or until the potatoes are very tender. \nWhisk flour into the heavy cream until smooth. \nStir the flour-cream mixture into the slow cooker. \nStir in the half-and-half or milk. Taste and add salt and pepper, as desired. Continue cooking until hot. \nUsing a potato masher or fork, mash the potatoes slightly to thicken; add more milk if the soup is too thick. \nServe the potato soup garnished with parsley, sliced green onions or chives, or a little bit of shredded cheese.",
"ingredients": [
{
"amount": 2,
"unit": {
"text": "tablespoons",
"id": 99364
"food": {
"name": "butter"
},
"ingredient": {
"text": "butter",
"id": 84919
"unit": {
"name": "tablespoons"
},
"note": "",
"original_text": "2 tablespoons butter"
"original_text": "2 tablespoons unsalted butter"
},
{
"amount": 1.5,
"food": {
"name": "2 cups coarsely chopped onion"
},
"unit": {
"text": "to",
"id": 15026
"name": "to"
},
"ingredient": {
"text": "2 cups onion",
"id": 89800
},
"note": "chopped",
"original_text": "1 1/2 to 2 cups onion (chopped)"
"note": "",
"original_text": "1 1/2 to 2 cups coarsely chopped onion"
},
{
"amount": 1,
"food": {
"name": "coarsely chopped celery"
},
"unit": {
"text": "cup",
"id": 74768
"name": "cups"
},
"ingredient": {
"text": "celery",
"id": 70601
},
"note": "chopped",
"original_text": "1 cup celery (chopped)"
"note": "",
"original_text": "1 cup coarsely chopped celery"
},
{
"amount": 2,
"food": {
"name": "carrots"
},
"unit": {
"text": "large",
"id": 39225
"name": "large"
},
"ingredient": {
"text": "carrots",
"id": 72417
},
"note": "peeled and chopped",
"original_text": "2 large carrots (peeled and chopped)"
},
{
"amount": 2,
"unit": {
"text": "to",
"id": 17146
},
"ingredient": {
"text": "3 cups ham",
"id": 14124
},
"note": "about 1 pound, diced",
"original_text": "2 to 3 cups ham (about 1 pound, diced)"
"note": "peeled and coarsely chopped",
"original_text": "2 large carrots, peeled and coarsely chopped"
},
{
"amount": 1,
"unit": {
"text": "clove",
"id": 59174
"food": {
"name": "ham"
},
"ingredient": {
"text": "garlic",
"id": 63566
"unit": {
"name": "pounds"
},
"note": "diced",
"original_text": "1 pound ham, diced"
},
{
"amount": 1,
"food": {
"name": "garlic"
},
"unit": {
"name": "cloves"
},
"note": "minced",
"original_text": "1 clove garlic (minced)"
"original_text": "1 clove garlic, minced"
},
{
"amount": 2,
"unit": {
"text": "cups",
"id": 38790
"food": {
"name": "vegetable broth"
},
"ingredient": {
"text": "vegetable broth",
"id": 10572
"unit": {
"name": "cups"
},
"note": "",
"original_text": "2 cups vegetable broth"
},
{
"amount": 1,
"unit": {
"text": "cup",
"id": 91657
"food": {
"name": "water"
},
"ingredient": {
"text": "water",
"id": 28583
"unit": {
"name": "cups"
},
"note": "",
"original_text": "1 cup water"
},
{
"amount": 4,
"food": {
"name": "5 cups diced peeled potatoes"
},
"unit": {
"text": "to",
"id": 35482
"name": "to"
},
"ingredient": {
"text": "5 cups potatoes",
"id": 16911
},
"note": "peeled and diced",
"original_text": "4 to 5 cups potatoes (peeled and diced)"
"note": "",
"original_text": "4 to 5 cups diced peeled potatoes"
},
{
"amount": 3,
"unit": {
"text": "tablespoons",
"id": 42650
"food": {
"name": "all purpose flour"
},
"ingredient": {
"text": "all-purpose flour",
"id": 40407
"unit": {
"name": "tablespoons"
},
"note": "",
"original_text": "3 tablespoons all-purpose flour"
},
{
"amount": 1,
"unit": {
"text": "cup",
"id": 26167
"food": {
"name": "heavy cream"
},
"ingredient": {
"text": "heavy cream",
"id": 19424
"unit": {
"name": "cups"
},
"note": "",
"original_text": "1 cup heavy cream"
},
{
"amount": 1,
"food": {
"name": "half-and-half"
},
"unit": {
"text": "cup",
"id": 55243
"name": "cups"
},
"ingredient": {
"text": "half-and-half",
"id": 61156
},
"note": "or whole milk, more if needed to thin",
"original_text": "1 cup half-and-half (or whole milk, more if needed to thin)"
"note": "or whole milk, more if needed",
"original_text": "1 cup half-and-half, or whole milk, more if needed"
},
{
"amount": 0,
"unit": {
"text": "",
"id": 48319
},
"ingredient": {
"text": "Dash salt",
"id": 75657
"food": {
"name": "salt"
},
"unit": None,
"note": "to taste",
"original_text": "Dash salt (to taste)"
"original_text": "Salt, to taste"
},
{
"amount": 0,
"unit": {
"text": "",
"id": 94308
},
"ingredient": {
"text": "Dash freshly ground black pepper",
"id": 49484
"food": {
"name": "Freshly ground black pepper"
},
"unit": None,
"note": "to taste",
"original_text": "Dash freshly ground black pepper (to taste)"
"original_text": "Freshly ground black pepper, to taste"
},
{
"amount": 2,
"food": {
"name": "finely chopped fresh parsley"
},
"unit": {
"name": "tablespoons"
},
"note": "optional",
"original_text": "2 tablespoons finely chopped fresh parsley, optional"
},
{
"amount": 0,
"unit": {
"text": "",
"id": 15775
"food": {
"name": "Thinly sliced green onions or chives"
},
"ingredient": {
"text": "Optional: 2 tablespoons fresh parsley",
"id": 73062
},
"note": "chopped",
"original_text": "Optional: 2 tablespoons fresh parsley (chopped)"
"unit": None,
"note": "for garnish",
"original_text": "Thinly sliced green onions or chives, for garnish"
},
{
"amount": 0,
"unit": {
"text": "",
"id": 18745
"food": {
"name": "Shredded cheddar cheese"
},
"ingredient": {
"text": "Garnish: green onions or chives",
"id": 73287
},
"note": "sliced",
"original_text": "Garnish: green onions or chives (sliced)"
},
{
"amount": 0,
"unit": {
"text": "",
"id": 51247
},
"ingredient": {
"text": "Optional: cheddar cheese or cheddar-jack blend",
"id": 18932
},
"note": "shredded",
"original_text": "Optional: cheddar cheese or cheddar-jack blend (shredded)"
"unit": None,
"note": "or cheddar-jack blend, for garnish, optional",
"original_text": "Shredded cheddar cheese, or cheddar-jack blend, for garnish, optional"
}
]
}
],
"recipeInstructions": "Gather the ingredients.\nIn a large saucepan, melt butter over medium-low heat.\nAdd onion, celery, carrots, and ham.\nCook, stirring frequently until onions are tender, about 5 minutes.\nAdd the garlic and continue cooking for 1 to 2 minutes longer.\nAdd vegetable broth, water, and potatoes.\nCover and cook for about 25 minutes, until potatoes are tender.\nWhisk flour into the heavy cream until smooth.\nStir into the hot mixture.\nStir in the half-and-half or milk. Taste and add salt and pepper, as desired. Continue cooking until hot.\nUsing a potato masher or fork, mash the potatoes slightly to thicken; add more milk if the soup is too thick.\nServe the potato soup garnished with parsley, sliced green onions or chives, or a little bit of shredded cheese.\nGather the ingredients.\nIn a large saucepan, melt butter over medium-low heat.\nAdd onion, celery, carrots, and ham.\nCook, stirring frequently until onions are tender, about 5 minutes.\nAdd the garlic and continue cooking for 1 to 2 minutes longer.\nThen transfer the cooked vegetables to the slow cooker and add the broth, water, and potatoes.\nCover and cook on HIGH for about 2 to 3 hours, or until the potatoes are very tender.\nWhisk flour into the heavy cream until smooth.\nStir the flour-cream mixture into the slow cooker.\nStir in the half-and-half or milk. Taste and add salt and pepper, as desired. Continue cooking until hot.\nUsing a potato masher or fork, mash the potatoes slightly to thicken; add more milk if the soup is too thick.\nServe the potato soup garnished with parsley, sliced green onions or chives, or a little bit of shredded cheese.\n\nImported from https://www.thespruceeats.com/creamy-potato-soup-with-ham-3059797",
"description": "This is a creamy potato soup with ham, garlic, cream, and chopped vegetables. This soup is easy to prepare and is ready in under an hour."
}
TUDOGOSTOSO = {

File diff suppressed because one or more lines are too long

View File

@ -2,14 +2,13 @@ import json
import os
import pytest
from django.urls import reverse
from ._recipes import (
ALLRECIPES, AMERICAS_TEST_KITCHEN, CHEF_KOCH, CHEF_KOCH2, COOKPAD,
from cookbook.tests.conftest import validate_recipe
from ._recipes import (ALLRECIPES, AMERICAS_TEST_KITCHEN, CHEF_KOCH, CHEF_KOCH2, COOKPAD,
COOKS_COUNTRY, DELISH, FOOD_NETWORK, GIALLOZAFFERANO, JOURNAL_DES_FEMMES,
MADAME_DESSERT, MARMITON, TASTE_OF_HOME, THE_SPRUCE_EATS, TUDOGOSTOSO)
from cookbook.tests.conftest import validate_recipe
IMPORT_SOURCE_URL = 'api_recipe_from_source'
DATA_DIR = "cookbook/tests/other/test_data/"
@ -36,13 +35,13 @@ def test_import_permission(arg, request):
@pytest.mark.parametrize("arg", [
ALLRECIPES,
# test of custom scraper ATK
# AMERICAS_TEST_KITCHEN, #TODO while the import trough the UI works the test fails for some reason, find out why
AMERICAS_TEST_KITCHEN,
CHEF_KOCH,
# test for empty ingredient in ingredient_parser
CHEF_KOCH2,
COOKPAD,
# test of custom scraper ATK
#COOKS_COUNTRY, #TODO while the import trough the UI works the test fails for some reason, find out why
COOKS_COUNTRY,
DELISH,
FOOD_NETWORK,
GIALLOZAFFERANO,
@ -53,7 +52,7 @@ def test_import_permission(arg, request):
MARMITON,
TASTE_OF_HOME,
# example of non-json recipes_scraper
# THE_SPRUCE_EATS, #TODO seems to be broken in recipe scrapers
THE_SPRUCE_EATS, # TODO seems to be broken in recipe scrapers
TUDOGOSTOSO,
])
def test_recipe_import(arg, u1_s1):

View File

@ -29,7 +29,7 @@ Jinja2==3.1.1
django-webpack-loader==1.4.1
django-js-reverse==0.9.1
django-allauth==0.50.0
recipe-scrapers==13.32.0
recipe-scrapers==13.32.1
django-scopes==1.2.0
pytest==7.1.1
pytest-django==4.5.2