Merge pull request #1793 from smilerz/url_import_test
fixed spuce eats test
This commit is contained in:
commit
876bd49ee5
@ -2226,237 +2226,238 @@ TASTE_OF_HOME = {
|
|||||||
THE_SPRUCE_EATS = {
|
THE_SPRUCE_EATS = {
|
||||||
'file': ['thespruceeats.html'],
|
'file': ['thespruceeats.html'],
|
||||||
'url': 'https://www.thespruceeats.com/creamy-potato-soup-with-ham-3059797',
|
'url': 'https://www.thespruceeats.com/creamy-potato-soup-with-ham-3059797',
|
||||||
|
|
||||||
"name": "Creamy Potato Soup With Ham",
|
"name": "Creamy Potato Soup With Ham",
|
||||||
"description": "",
|
|
||||||
"servings": 6,
|
"servings": 6,
|
||||||
"prepTime": 55,
|
"servings_text": "servings",
|
||||||
"cookTime": 0,
|
"working_time": 20,
|
||||||
"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',
|
"waiting_time": 35,
|
||||||
"keywords": [],
|
"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",
|
||||||
"recipeIngredient": [
|
"source_url": "https://www.thespruceeats.com/creamy-potato-soup-with-ham-3059797",
|
||||||
|
"keywords": [
|
||||||
|
{
|
||||||
|
"label": "soup",
|
||||||
|
"name": "soup",
|
||||||
|
"id": 18,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"amount": 2,
|
"label": "lunch",
|
||||||
"unit": {
|
"name": "lunch",
|
||||||
"text": "tablespoons",
|
|
||||||
"id": 99364
|
|
||||||
},
|
},
|
||||||
"ingredient": {
|
|
||||||
"text": "butter",
|
|
||||||
"id": 84919
|
|
||||||
},
|
|
||||||
"note": "",
|
|
||||||
"original_text": "2 tablespoons butter"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"amount": 1.5,
|
"label": "entree",
|
||||||
"unit": {
|
"name": "entree",
|
||||||
"text": "to",
|
|
||||||
"id": 15026
|
|
||||||
},
|
},
|
||||||
"ingredient": {
|
|
||||||
"text": "2 cups onion",
|
|
||||||
"id": 89800
|
|
||||||
},
|
|
||||||
"note": "chopped",
|
|
||||||
"original_text": "1 1/2 to 2 cups onion (chopped)"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"amount": 1,
|
"label": "side dish",
|
||||||
"unit": {
|
"name": "side dish",
|
||||||
"text": "cup",
|
"id": 14,
|
||||||
"id": 74768
|
|
||||||
},
|
},
|
||||||
"ingredient": {
|
|
||||||
"text": "celery",
|
|
||||||
"id": 70601
|
|
||||||
},
|
|
||||||
"note": "chopped",
|
|
||||||
"original_text": "1 cup celery (chopped)"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"amount": 2,
|
"label": "www.thespruceeats.com",
|
||||||
"unit": {
|
"name": "www.thespruceeats.com",
|
||||||
"text": "large",
|
|
||||||
"id": 39225
|
|
||||||
},
|
},
|
||||||
"ingredient": {
|
|
||||||
"text": "carrots",
|
|
||||||
"id": 72417
|
|
||||||
},
|
|
||||||
"note": "peeled and chopped",
|
|
||||||
"original_text": "2 large carrots (peeled and chopped)"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"amount": 2,
|
"label": "southern",
|
||||||
"unit": {
|
"name": "southern",
|
||||||
"text": "to",
|
"id": 27,
|
||||||
"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)"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"amount": 1,
|
"label": "cheddar",
|
||||||
"unit": {
|
"name": "cheddar",
|
||||||
"text": "clove",
|
|
||||||
"id": 59174
|
|
||||||
},
|
},
|
||||||
"ingredient": {
|
|
||||||
"text": "garlic",
|
|
||||||
"id": 63566
|
|
||||||
},
|
|
||||||
"note": "minced",
|
|
||||||
"original_text": "1 clove garlic (minced)"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"amount": 2,
|
"label": "dinner",
|
||||||
"unit": {
|
"name": "dinner",
|
||||||
"text": "cups",
|
}
|
||||||
"id": 38790
|
],
|
||||||
},
|
"steps": [
|
||||||
"ingredient": {
|
|
||||||
"text": "vegetable broth",
|
|
||||||
"id": 10572
|
|
||||||
},
|
|
||||||
"note": "",
|
|
||||||
"original_text": "2 cups vegetable broth"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"amount": 1,
|
"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.",
|
||||||
"unit": {
|
"ingredients": [
|
||||||
"text": "cup",
|
{
|
||||||
"id": 91657
|
"amount": 2,
|
||||||
},
|
"food": {
|
||||||
"ingredient": {
|
"name": "butter"
|
||||||
"text": "water",
|
},
|
||||||
"id": 28583
|
"unit": {
|
||||||
},
|
"name": "tablespoons"
|
||||||
"note": "",
|
},
|
||||||
"original_text": "1 cup water"
|
"note": "",
|
||||||
},
|
"original_text": "2 tablespoons unsalted butter"
|
||||||
{
|
},
|
||||||
"amount": 4,
|
{
|
||||||
"unit": {
|
"amount": 1.5,
|
||||||
"text": "to",
|
"food": {
|
||||||
"id": 35482
|
"name": "2 cups coarsely chopped onion"
|
||||||
},
|
},
|
||||||
"ingredient": {
|
"unit": {
|
||||||
"text": "5 cups potatoes",
|
"name": "to"
|
||||||
"id": 16911
|
},
|
||||||
},
|
"note": "",
|
||||||
"note": "peeled and diced",
|
"original_text": "1 1/2 to 2 cups coarsely chopped onion"
|
||||||
"original_text": "4 to 5 cups potatoes (peeled and diced)"
|
},
|
||||||
},
|
{
|
||||||
{
|
"amount": 1,
|
||||||
"amount": 3,
|
"food": {
|
||||||
"unit": {
|
"name": "coarsely chopped celery"
|
||||||
"text": "tablespoons",
|
},
|
||||||
"id": 42650
|
"unit": {
|
||||||
},
|
"name": "cups"
|
||||||
"ingredient": {
|
},
|
||||||
"text": "all-purpose flour",
|
"note": "",
|
||||||
"id": 40407
|
"original_text": "1 cup coarsely chopped celery"
|
||||||
},
|
},
|
||||||
"note": "",
|
{
|
||||||
"original_text": "3 tablespoons all-purpose flour"
|
"amount": 2,
|
||||||
},
|
"food": {
|
||||||
{
|
"name": "carrots"
|
||||||
"amount": 1,
|
},
|
||||||
"unit": {
|
"unit": {
|
||||||
"text": "cup",
|
"name": "large"
|
||||||
"id": 26167
|
},
|
||||||
},
|
"note": "peeled and coarsely chopped",
|
||||||
"ingredient": {
|
"original_text": "2 large carrots, peeled and coarsely chopped"
|
||||||
"text": "heavy cream",
|
},
|
||||||
"id": 19424
|
{
|
||||||
},
|
"amount": 1,
|
||||||
"note": "",
|
"food": {
|
||||||
"original_text": "1 cup heavy cream"
|
"name": "ham"
|
||||||
},
|
},
|
||||||
{
|
"unit": {
|
||||||
"amount": 1,
|
"name": "pounds"
|
||||||
"unit": {
|
},
|
||||||
"text": "cup",
|
"note": "diced",
|
||||||
"id": 55243
|
"original_text": "1 pound ham, diced"
|
||||||
},
|
},
|
||||||
"ingredient": {
|
{
|
||||||
"text": "half-and-half",
|
"amount": 1,
|
||||||
"id": 61156
|
"food": {
|
||||||
},
|
"name": "garlic"
|
||||||
"note": "or whole milk, more if needed to thin",
|
},
|
||||||
"original_text": "1 cup half-and-half (or whole milk, more if needed to thin)"
|
"unit": {
|
||||||
},
|
"name": "cloves"
|
||||||
{
|
},
|
||||||
"amount": 0,
|
"note": "minced",
|
||||||
"unit": {
|
"original_text": "1 clove garlic, minced"
|
||||||
"text": "",
|
},
|
||||||
"id": 48319
|
{
|
||||||
},
|
"amount": 2,
|
||||||
"ingredient": {
|
"food": {
|
||||||
"text": "Dash salt",
|
"name": "vegetable broth"
|
||||||
"id": 75657
|
},
|
||||||
},
|
"unit": {
|
||||||
"note": "to taste",
|
"name": "cups"
|
||||||
"original_text": "Dash salt (to taste)"
|
},
|
||||||
},
|
"note": "",
|
||||||
{
|
"original_text": "2 cups vegetable broth"
|
||||||
"amount": 0,
|
},
|
||||||
"unit": {
|
{
|
||||||
"text": "",
|
"amount": 1,
|
||||||
"id": 94308
|
"food": {
|
||||||
},
|
"name": "water"
|
||||||
"ingredient": {
|
},
|
||||||
"text": "Dash freshly ground black pepper",
|
"unit": {
|
||||||
"id": 49484
|
"name": "cups"
|
||||||
},
|
},
|
||||||
"note": "to taste",
|
"note": "",
|
||||||
"original_text": "Dash freshly ground black pepper (to taste)"
|
"original_text": "1 cup water"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amount": 0,
|
"amount": 4,
|
||||||
"unit": {
|
"food": {
|
||||||
"text": "",
|
"name": "5 cups diced peeled potatoes"
|
||||||
"id": 15775
|
},
|
||||||
},
|
"unit": {
|
||||||
"ingredient": {
|
"name": "to"
|
||||||
"text": "Optional: 2 tablespoons fresh parsley",
|
},
|
||||||
"id": 73062
|
"note": "",
|
||||||
},
|
"original_text": "4 to 5 cups diced peeled potatoes"
|
||||||
"note": "chopped",
|
},
|
||||||
"original_text": "Optional: 2 tablespoons fresh parsley (chopped)"
|
{
|
||||||
},
|
"amount": 3,
|
||||||
{
|
"food": {
|
||||||
"amount": 0,
|
"name": "all purpose flour"
|
||||||
"unit": {
|
},
|
||||||
"text": "",
|
"unit": {
|
||||||
"id": 18745
|
"name": "tablespoons"
|
||||||
},
|
},
|
||||||
"ingredient": {
|
"note": "",
|
||||||
"text": "Garnish: green onions or chives",
|
"original_text": "3 tablespoons all-purpose flour"
|
||||||
"id": 73287
|
},
|
||||||
},
|
{
|
||||||
"note": "sliced",
|
"amount": 1,
|
||||||
"original_text": "Garnish: green onions or chives (sliced)"
|
"food": {
|
||||||
},
|
"name": "heavy cream"
|
||||||
{
|
},
|
||||||
"amount": 0,
|
"unit": {
|
||||||
"unit": {
|
"name": "cups"
|
||||||
"text": "",
|
},
|
||||||
"id": 51247
|
"note": "",
|
||||||
},
|
"original_text": "1 cup heavy cream"
|
||||||
"ingredient": {
|
},
|
||||||
"text": "Optional: cheddar cheese or cheddar-jack blend",
|
{
|
||||||
"id": 18932
|
"amount": 1,
|
||||||
},
|
"food": {
|
||||||
"note": "shredded",
|
"name": "half-and-half"
|
||||||
"original_text": "Optional: cheddar cheese or cheddar-jack blend (shredded)"
|
},
|
||||||
|
"unit": {
|
||||||
|
"name": "cups"
|
||||||
|
},
|
||||||
|
"note": "or whole milk, more if needed",
|
||||||
|
"original_text": "1 cup half-and-half, or whole milk, more if needed"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amount": 0,
|
||||||
|
"food": {
|
||||||
|
"name": "salt"
|
||||||
|
},
|
||||||
|
"unit": None,
|
||||||
|
"note": "to taste",
|
||||||
|
"original_text": "Salt, to taste"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amount": 0,
|
||||||
|
"food": {
|
||||||
|
"name": "Freshly ground black pepper"
|
||||||
|
},
|
||||||
|
"unit": None,
|
||||||
|
"note": "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,
|
||||||
|
"food": {
|
||||||
|
"name": "Thinly sliced green onions or chives"
|
||||||
|
},
|
||||||
|
"unit": None,
|
||||||
|
"note": "for garnish",
|
||||||
|
"original_text": "Thinly sliced green onions or chives, for garnish"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amount": 0,
|
||||||
|
"food": {
|
||||||
|
"name": "Shredded cheddar cheese"
|
||||||
|
},
|
||||||
|
"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 = {
|
TUDOGOSTOSO = {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -2,15 +2,14 @@ import json
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
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
|
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)
|
||||||
|
|
||||||
IMPORT_SOURCE_URL = 'api_recipe_from_source'
|
IMPORT_SOURCE_URL = 'api_recipe_from_source'
|
||||||
DATA_DIR = "cookbook/tests/other/test_data/"
|
DATA_DIR = "cookbook/tests/other/test_data/"
|
||||||
|
|
||||||
@ -36,13 +35,13 @@ def test_import_permission(arg, request):
|
|||||||
@pytest.mark.parametrize("arg", [
|
@pytest.mark.parametrize("arg", [
|
||||||
ALLRECIPES,
|
ALLRECIPES,
|
||||||
# test of custom scraper ATK
|
# 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,
|
CHEF_KOCH,
|
||||||
# test for empty ingredient in ingredient_parser
|
# test for empty ingredient in ingredient_parser
|
||||||
CHEF_KOCH2,
|
CHEF_KOCH2,
|
||||||
COOKPAD,
|
COOKPAD,
|
||||||
# test of custom scraper ATK
|
# 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,
|
DELISH,
|
||||||
FOOD_NETWORK,
|
FOOD_NETWORK,
|
||||||
GIALLOZAFFERANO,
|
GIALLOZAFFERANO,
|
||||||
@ -53,7 +52,7 @@ def test_import_permission(arg, request):
|
|||||||
MARMITON,
|
MARMITON,
|
||||||
TASTE_OF_HOME,
|
TASTE_OF_HOME,
|
||||||
# example of non-json recipes_scraper
|
# 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,
|
TUDOGOSTOSO,
|
||||||
])
|
])
|
||||||
def test_recipe_import(arg, u1_s1):
|
def test_recipe_import(arg, u1_s1):
|
||||||
|
Loading…
Reference in New Issue
Block a user