feat(计划): 评论计划勾选项 + 待评论计数
- ae_plan 新增 comment_mode(schema v26) - 计划编辑器勾「评论计划」:账号显示待评论 N、隐藏视频未发/素材区,段内禁止发布素材 - list_accounts 带 comment_pending;comment.pending_counts 按账号汇总 - 计划列表显示评论待处理总数与「评论」标签 - 测试 test_comment/test_plan
This commit is contained in:
@@ -21,6 +21,7 @@ os.chdir(_ROOT)
|
||||
from flask import Flask # noqa: E402
|
||||
from core.models import db, init_db, DeviceAccount, CommentItem # noqa: E402
|
||||
from core import comment as cm # noqa: E402
|
||||
from core import account_folder as af # noqa: E402
|
||||
from tasks.generic import task as gt # noqa: E402
|
||||
|
||||
fails = []
|
||||
@@ -39,6 +40,7 @@ app.config["SQLALCHEMY_DATABASE_URI"] = os.environ["DATABASE_URL"]
|
||||
with app.app_context():
|
||||
init_db(app)
|
||||
cm.init_app(app)
|
||||
af._app = app
|
||||
|
||||
|
||||
def reset_db():
|
||||
@@ -80,6 +82,9 @@ with app.app_context():
|
||||
row = CommentItem.query.filter_by(account_name="号甲").first()
|
||||
check("入库 pending", row.status, "pending")
|
||||
check("account_id", row.account_id, "a1")
|
||||
_accts = af.list_accounts()
|
||||
_acct = [x for x in _accts if x["name"] == "号甲"][0]
|
||||
check("资产表带待评论数", _acct.get("comment_pending"), 1)
|
||||
r = cm.import_comments(txt.replace("第一条", "改过的"))
|
||||
check("重复导入更新", (r["added"], r["updated"]), (0, 1))
|
||||
with app.app_context():
|
||||
|
||||
@@ -360,6 +360,10 @@ try:
|
||||
"action_id": "act1", "app_id": "app1",
|
||||
"material": {"per_account": 5}}, r["id"])["ok"], True)
|
||||
check("读回来是改后的", plan_mod.get_plan(r["id"])["material"]["per_account"], 5)
|
||||
check("评论计划标记保存成功",
|
||||
plan_mod.save_plan({"name": "夜间发布", "accounts": ["号甲"],
|
||||
"comment_mode": True}, r["id"])["ok"], True)
|
||||
check("评论计划标记读回", plan_mod.get_plan(r["id"])["comment_mode"], True)
|
||||
check("只有一条计划(没重复建)", len(plan_mod.list_plans()), 1)
|
||||
rseg = plan_mod.save_plan({"name": "编排计划", "accounts": ["号甲"], "segments": [
|
||||
{"action_id": "act1", "app_id": "app1", "name": "发布", "publish": True,
|
||||
|
||||
Reference in New Issue
Block a user