feat: Zutaten im Listendialog dem BLS zuordnen
Mapping-Status pro Zutat, Suche zuerst Listen und eigene Foods. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b37005be01
commit
a5adff6196
10 files changed
+237
-23
No files matched your search
@@ -1,4 +1,24 @@
|
||||
from data_layer.food_recipes import save_recipe
|
||||
from data_layer.food_recipes import list_known_ingredient_names, save_recipe
|
||||
|
||||
|
||||
class _FakeCur:
|
||||
def __init__(self, rows):
|
||||
self.rows = rows
|
||||
|
||||
def execute(self, sql, params=None):
|
||||
return None
|
||||
|
||||
def fetchall(self):
|
||||
return self.rows
|
||||
|
||||
|
||||
def test_known_ingredient_names_flags_mapping():
|
||||
rows = list_known_ingredient_names(_FakeCur([
|
||||
{"source_name_raw": "Hafer", "source_name_normalized": "hafer", "food_id": "1", "food_name_de": "Haferflocken", "bls_code": "B123", "mapped": True},
|
||||
{"source_name_raw": "Salz", "source_name_normalized": "salz", "food_id": None, "food_name_de": None, "bls_code": None, "mapped": False},
|
||||
]), "p")
|
||||
assert rows[0]["mapped"] is True
|
||||
assert rows[1]["mapped"] is False
|
||||
|
||||
|
||||
def test_save_recipe_requires_name():
|
||||
|
||||
Reference in new issue
Block a user