本文整理汇总了Python中stoqlib.lib.formatters.format_sellable_description函数的典型用法代码示例。如果您正苦于以下问题:Python format_sellable_description函数的具体用法?Python format_sellable_description怎么用?Python format_sellable_description使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了format_sellable_description函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_format_sellable_description
def test_format_sellable_description(self):
sellable = self.create_sellable()
sellable.description = u"Cellphone"
self.assertEqual(format_sellable_description(sellable),
u"Cellphone")
storable = self.create_storable(product=sellable.product)
batch = self.create_storable_batch(storable=storable,
batch_number=u'666')
self.assertEqual(format_sellable_description(sellable, batch=batch),
u"Cellphone [Batch: 666]")
示例2: description
def description(self):
return format_sellable_description(self.sellable, self.batch)
示例3: _format_description
def _format_description(self, item, data): # pragma no cover
return format_sellable_description(item.sellable, item.batch)