fix(pl): 证书齐备按计划日期正序,并默认未齐备与近期日期。
Web 与小程序共用列表接口,打开时只看未齐备,计划日期从昨天起共 8 天;同时让移动端筛选下拉从筛选条向下展开。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
13cf2e216d
commit
da8499bc92
8 files changed
+202
-7
No files matched your search
@@ -4,6 +4,40 @@ from types import SimpleNamespace
|
||||
from fastapi import HTTPException
|
||||
|
||||
|
||||
def test_ready_list_orders_by_plan_date_ascending(monkeypatch):
|
||||
from app.services import pl_quota_waiver as svc
|
||||
|
||||
monkeypatch.setattr(svc, "_toxic_exists", lambda *args, **kwargs: True)
|
||||
monkeypatch.setattr(svc, "apply_pl_scope", lambda query, *args, **kwargs: query)
|
||||
monkeypatch.setattr(svc, "_product_names", lambda *args, **kwargs: {})
|
||||
orders = []
|
||||
|
||||
class Query:
|
||||
def filter(self, *args, **kwargs):
|
||||
return self
|
||||
|
||||
def order_by(self, *args):
|
||||
orders.extend(args)
|
||||
return self
|
||||
|
||||
def count(self):
|
||||
return 0
|
||||
|
||||
def offset(self, _n):
|
||||
return self
|
||||
|
||||
def limit(self, _n):
|
||||
return self
|
||||
|
||||
def all(self):
|
||||
return []
|
||||
|
||||
svc.list_ready_plans(SimpleNamespace(query=lambda *_args, **_kwargs: Query()), SimpleNamespace(tenant_no="t"))
|
||||
text = " ".join(str(item).lower() for item in orders)
|
||||
assert "plan_date asc" in text
|
||||
assert "create_time desc" not in text
|
||||
|
||||
|
||||
def test_only_external_toxic_stops_need_both_certs():
|
||||
from app.services.pl_quota_waiver import needs_purchase_transport_cert
|
||||
|
||||
|
||||
Reference in new issue
Block a user