feat: explain product suite multi-image generation

This commit is contained in:
chengma
2026-07-17 17:10:13 +08:00
parent f64dfffe40
commit def05c9ae8
6 changed files with 87 additions and 6 deletions
+40 -1
View File
@@ -3285,11 +3285,50 @@ class ProductSuiteGuiTests(TempDirMixin, unittest.TestCase):
)
self.assertIn("逐图主图:未开启", message)
self.assertIn("所有分类都只使用第一张可用原图生成", message)
self.assertIn("第1张可用原图作为主图,另有1张参考图会随每次请求一同提交", message)
self.assertIn("本次生成总数:5张", message)
self.assert_removed(temp_dir)
def test_per_image_helper_and_confirmation_explain_reference_limit(self):
with self.make_temp_dir() as temp_dir:
config = self._config(temp_dir)
project, assets = self._create_project_with_assets(temp_dir, config, 9)
tab = ProductSuiteTab(config=config, db_path=config["db_path"])
self.addCleanup(tab.close)
tab.resize(1180, 760)
tab.show()
self.app.processEvents()
state = tab._displayed_state
state.account_alias = "alias-a"
state.item_id = project.item_id
state.project_id = project.id
state.project_binding_state = project.binding_state
state.settings["per_image_primary"] = False
tab._load_state(state)
self.app.processEvents()
specs = product_suite.build_job_specs(
assets,
"商品卖点",
state.settings,
state.item_id,
template_text=prompts.load_product_suite_prompt(tab.product_suite_prompt_path),
)
self.assertTrue(tab.per_image_helper_label.wordWrap())
self.assertGreater(tab.per_image_helper_label.width(), 0)
self.assertIn("多SKU图请勾选", tab.per_image_helper_label.text())
self.assertGreater(
tab.per_image_helper_label.geometry().left(),
tab.per_image_checkbox.geometry().left(),
)
message = tab._generation_confirmation_message(state, assets, specs)
self.assertIn("另有7张参考图会随每次请求一同提交", message)
self.assertIn("参考图仅取前7张,其余1张不参与本轮生成", message)
self.assert_removed(temp_dir)
def test_generation_confirmation_rejects_plan_changed_while_reading_price(self):
with self.make_temp_dir() as temp_dir:
config = self._config(temp_dir)