本文整理汇总了Python中mkt.webapps.models.Webapp.is_premium_type_upgrade方法的典型用法代码示例。如果您正苦于以下问题:Python Webapp.is_premium_type_upgrade方法的具体用法?Python Webapp.is_premium_type_upgrade怎么用?Python Webapp.is_premium_type_upgrade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mkt.webapps.models.Webapp
的用法示例。
在下文中一共展示了Webapp.is_premium_type_upgrade方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_is_premium_type_upgrade_check
# 需要导入模块: from mkt.webapps.models import Webapp [as 别名]
# 或者: from mkt.webapps.models.Webapp import is_premium_type_upgrade [as 别名]
def test_is_premium_type_upgrade_check(self):
app = Webapp()
ALL = set(amo.ADDON_FREES + amo.ADDON_PREMIUMS)
free_upgrade = ALL - set([amo.ADDON_FREE])
free_inapp_upgrade = ALL - set([amo.ADDON_FREE, amo.ADDON_FREE_INAPP])
# Checking ADDON_FREE changes.
app.premium_type = amo.ADDON_FREE
for pt in ALL:
eq_(app.is_premium_type_upgrade(pt), pt in free_upgrade)
# Checking ADDON_FREE_INAPP changes.
app.premium_type = amo.ADDON_FREE_INAPP
for pt in ALL:
eq_(app.is_premium_type_upgrade(pt), pt in free_inapp_upgrade)
# All else is false.
for pt_old in ALL - set([amo.ADDON_FREE, amo.ADDON_FREE_INAPP]):
app.premium_type = pt_old
for pt_new in ALL:
eq_(app.is_premium_type_upgrade(pt_new), False)