本文整理汇总了Python中plone.app.contentlisting.interfaces.IContentListingObject.discount_available方法的典型用法代码示例。如果您正苦于以下问题:Python IContentListingObject.discount_available方法的具体用法?Python IContentListingObject.discount_available怎么用?Python IContentListingObject.discount_available使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plone.app.contentlisting.interfaces.IContentListingObject
的用法示例。
在下文中一共展示了IContentListingObject.discount_available方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_discount_available
# 需要导入模块: from plone.app.contentlisting.interfaces import IContentListingObject [as 别名]
# 或者: from plone.app.contentlisting.interfaces.IContentListingObject import discount_available [as 别名]
def test_discount_available(self):
article = self.create_content('collective.cart.core.Article')
instance = IContentListingObject(article)
self.assertFalse(instance.discount_available())
instance.adapter = mock.Mock()
instance.adapter.discount_available.ruturn_value = True
self.assertTrue(instance.discount_available())
示例2: test_klass
# 需要导入模块: from plone.app.contentlisting.interfaces import IContentListingObject [as 别名]
# 或者: from plone.app.contentlisting.interfaces.IContentListingObject import discount_available [as 别名]
def test_klass(self):
article = self.create_content('collective.cart.core.Article')
instance = IContentListingObject(article)
self.assertEqual(instance.klass(), 'normal')
instance.discount_available = mock.Mock()
self.assertEqual(instance.klass(), 'discount')