refactor(products): remove obsolete interaction fields across stack
This commit is contained in:
parent
1d8a8eafb8
commit
c5ea38880c
16 changed files with 32 additions and 278 deletions
|
|
@ -7,14 +7,12 @@ from innercontext.models import Product
|
|||
from innercontext.models.enums import (
|
||||
DayTime,
|
||||
IngredientFunction,
|
||||
InteractionScope,
|
||||
ProductCategory,
|
||||
)
|
||||
from innercontext.models.product import (
|
||||
ActiveIngredient,
|
||||
ProductContext,
|
||||
ProductEffectProfile,
|
||||
ProductInteraction,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -156,29 +154,6 @@ def test_effect_profile_nonzero_included():
|
|||
assert "retinoid_strength" not in ctx["effect_profile"]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Incompatible_with
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def test_incompatible_with_pydantic_objects():
|
||||
inc = ProductInteraction(
|
||||
target="AHA", scope=InteractionScope.SAME_DAY, reason="increases irritation"
|
||||
)
|
||||
p = _make(incompatible_with=[inc])
|
||||
ctx = p.to_llm_context()
|
||||
assert "incompatible_with" in ctx
|
||||
assert ctx["incompatible_with"][0] == "avoid AHA (same_day): increases irritation"
|
||||
|
||||
|
||||
def test_incompatible_with_raw_dicts():
|
||||
raw = {"target": "Vitamin C", "scope": "same_step", "reason": None}
|
||||
p = _make(incompatible_with=[raw])
|
||||
ctx = p.to_llm_context()
|
||||
assert "incompatible_with" in ctx
|
||||
assert ctx["incompatible_with"][0] == "avoid Vitamin C (same_step)"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Context rules
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue