本文整理匯總了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)