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