fix(product-suite): allow braces in business prompts
This commit is contained in:
@@ -294,6 +294,21 @@ class ProductSuiteTests(unittest.TestCase):
|
||||
self.assertIn("商品ID:未绑定商品", rendered)
|
||||
self.assertIn("参考图序号:2", rendered)
|
||||
|
||||
def test_business_prompt_braces_are_not_reparsed_as_template_variables(self):
|
||||
template = prompts.load_default_product_suite_prompt()
|
||||
business_prompt = "适合 {儿童} 使用,支持 {日常通勤} 场景"
|
||||
|
||||
rendered = product_suite.build_suite_prompt(
|
||||
business_prompt,
|
||||
product_suite.default_suite_settings(),
|
||||
"白底图",
|
||||
"51100639510",
|
||||
template_text=template,
|
||||
)
|
||||
|
||||
self.assertIn(business_prompt, rendered)
|
||||
self.assertEqual([], product_suite.product_suite_prompt_errors(template))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user