本文整理汇总了Python中the_tale.game.bills.prototypes.BillPrototype.get_applicable_bills方法的典型用法代码示例。如果您正苦于以下问题:Python BillPrototype.get_applicable_bills方法的具体用法?Python BillPrototype.get_applicable_bills怎么用?Python BillPrototype.get_applicable_bills使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类the_tale.game.bills.prototypes.BillPrototype
的用法示例。
在下文中一共展示了BillPrototype.get_applicable_bills方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_wrong_state
# 需要导入模块: from the_tale.game.bills.prototypes import BillPrototype [as 别名]
# 或者: from the_tale.game.bills.prototypes.BillPrototype import get_applicable_bills [as 别名]
def test_wrong_state(self):
for state in relations.BILL_STATE.records:
if state.is_VOTING:
continue
self.bill_1.state = state
self.bill_1.save()
self.assertEqual(set(bill.id for bill in BillPrototype.get_applicable_bills()), set((self.bill_2.id, self.bill_3.id)))
示例2: apply_bills
# 需要导入模块: from the_tale.game.bills.prototypes import BillPrototype [as 别名]
# 或者: from the_tale.game.bills.prototypes.BillPrototype import get_applicable_bills [as 别名]
def apply_bills(self):
from the_tale.game.bills.prototypes import BillPrototype
self.logger.info('apply bills')
applied = False
for bill in BillPrototype.get_applicable_bills():
applied = bill.apply() or applied
self.logger.info('apply bills completed')
return applied
示例3: test_voting_not_ended
# 需要导入模块: from the_tale.game.bills.prototypes import BillPrototype [as 别名]
# 或者: from the_tale.game.bills.prototypes.BillPrototype import get_applicable_bills [as 别名]
def test_voting_not_ended(self):
self.bill_3._model.updated_at = datetime.datetime.now()
self.bill_3.save()
self.assertEqual(set(bill.id for bill in BillPrototype.get_applicable_bills()), set((self.bill_1.id, self.bill_2.id)))
示例4: test_approved_by_moderator
# 需要导入模块: from the_tale.game.bills.prototypes import BillPrototype [as 别名]
# 或者: from the_tale.game.bills.prototypes.BillPrototype import get_applicable_bills [as 别名]
def test_approved_by_moderator(self):
self.bill_2.approved_by_moderator = False
self.bill_2.save()
self.assertEqual(set(bill.id for bill in BillPrototype.get_applicable_bills()), set((self.bill_1.id, self.bill_3.id)))
示例5: test_all
# 需要导入模块: from the_tale.game.bills.prototypes import BillPrototype [as 别名]
# 或者: from the_tale.game.bills.prototypes.BillPrototype import get_applicable_bills [as 别名]
def test_all(self):
self.assertEqual(set(bill.id for bill in BillPrototype.get_applicable_bills()),
set((self.bill_1.id, self.bill_2.id, self.bill_3.id)))