v0.1.12
This commit is contained in:
@@ -246,7 +246,7 @@ def test_mix_calculator_options_hide_invisible_products_and_clients():
|
||||
options = build_mix_calculator_options(db, tenant_id="hunter-premium-produce")
|
||||
|
||||
assert options["clients"] == ["Peckish"]
|
||||
assert [product["product_name"] for product in options["products"]] == ["Visible Product"]
|
||||
assert [product["product_name"] for product in options["products"]] == ["Visible Mix"]
|
||||
assert options["products"][0]["mix_total_kg"] == 20
|
||||
|
||||
|
||||
@@ -482,8 +482,12 @@ def test_mix_calculator_endpoints_respect_owner_visibility():
|
||||
options_response = client.get("/api/mix-calculator/options", cookies=superadmin_cookies)
|
||||
assert options_response.status_code == 200
|
||||
options_payload = options_response.json()
|
||||
assert len(options_payload["products"]) >= 100
|
||||
seeded_product = next(product for product in options_payload["products"] if product["product_name"] == "Specialty Pigeon Breeder 20kg")
|
||||
assert len(options_payload["products"]) == 84
|
||||
seeded_product = next(
|
||||
product
|
||||
for product in options_payload["products"]
|
||||
if product["client_name"] == "Specialty" and product["product_name"] == "Pigeon Mix"
|
||||
)
|
||||
assert seeded_product["unit_size_kg"] == 20
|
||||
|
||||
create_response = client.post(
|
||||
@@ -540,7 +544,9 @@ def test_mix_calculator_pdf_endpoint_returns_pdf():
|
||||
|
||||
options_response = client.get("/api/mix-calculator/options", cookies=superadmin_cookies)
|
||||
seeded_product = next(
|
||||
product for product in options_response.json()["products"] if product["product_name"] == "Specialty Pigeon Breeder 20kg"
|
||||
product
|
||||
for product in options_response.json()["products"]
|
||||
if product["client_name"] == "Specialty" and product["product_name"] == "Pigeon Mix"
|
||||
)
|
||||
|
||||
create_response = client.post(
|
||||
|
||||
Reference in New Issue
Block a user