Files
shanxia2.0/backend/tests/test_pl_facet_context.py
T
wuzilongandCursor 6a8cd90b98 feat: cascade column facet options by current list context
Make dynamic column-facet values respect other active filters (Excel-style), with backend facet context helpers, list-page wiring, slip print/sidebar fixes, and refreshed graphify graphs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-11 22:04:20 +08:00

32 lines
921 B
Python

"""PL 通用 facet 上下文剥离单测。"""
from app.services.pl.facet_context import strip_simple_facet_self_params
def test_strip_carrier_name():
params = {
"field": "carrierName",
"limit": 500,
"carrierNameIn": "甲",
"contactNameIn": "张三",
"statusIn": "1",
"q": "搜",
}
out = strip_simple_facet_self_params(params, "carrierName")
assert "carrierNameIn" not in out
assert out["contactNameIn"] == "张三"
assert out["statusIn"] == "1"
assert out["q"] == "搜"
assert "field" not in out
def test_strip_keeps_vehicle_type():
params = {
"licensePlateIn": "浙A",
"vehicleType": "self",
"vehicleStatusIn": "1",
}
out = strip_simple_facet_self_params(params, "licensePlate")
assert "licensePlateIn" not in out
assert out["vehicleType"] == "self"
assert out["vehicleStatusIn"] == "1"