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>
32 lines
921 B
Python
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"
|