本文整理汇总了Python中stoqlib.domain.sellable.SellableCategory.tax_constant方法的典型用法代码示例。如果您正苦于以下问题:Python SellableCategory.tax_constant方法的具体用法?Python SellableCategory.tax_constant怎么用?Python SellableCategory.tax_constant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.domain.sellable.SellableCategory
的用法示例。
在下文中一共展示了SellableCategory.tax_constant方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_tax_constant
# 需要导入模块: from stoqlib.domain.sellable import SellableCategory [as 别名]
# 或者: from stoqlib.domain.sellable.SellableCategory import tax_constant [as 别名]
def test_get_tax_constant(self):
base_category = SellableCategory(description=u"Monitor",
store=self.store)
category = SellableCategory(description=u"LCD Monitor",
category=base_category,
store=self.store)
sellable = self.create_sellable()
sellable.tax_constant = None
sellable.category = category
self.assertEquals(sellable.get_tax_constant(), None)
constant = self.create_sellable_tax_constant()
base_category.tax_constant = constant
self.assertEquals(sellable.get_tax_constant(), constant)
constant2 = self.create_sellable_tax_constant()
category.tax_constant = constant2
self.assertEquals(sellable.get_tax_constant(), constant2)
constant3 = self.create_sellable_tax_constant()
sellable.tax_constant = constant3
self.assertEquals(sellable.get_tax_constant(), constant3)