本文整理汇总了Python中the_tale.finances.bank.prototypes.InvoicePrototype.check_frozen_expired_invoices方法的典型用法代码示例。如果您正苦于以下问题:Python InvoicePrototype.check_frozen_expired_invoices方法的具体用法?Python InvoicePrototype.check_frozen_expired_invoices怎么用?Python InvoicePrototype.check_frozen_expired_invoices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类the_tale.finances.bank.prototypes.InvoicePrototype
的用法示例。
在下文中一共展示了InvoicePrototype.check_frozen_expired_invoices方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_check_frozen_expired_invoices__wrong_state
# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import check_frozen_expired_invoices [as 别名]
def test_check_frozen_expired_invoices__wrong_state(self):
for state in INVOICE_STATE.records:
if state.is_FROZEN:
continue
self.create_invoice(state=state)
self.assertFalse(InvoicePrototype.check_frozen_expired_invoices())
InvoicePrototype._db_all().delete()
示例2: check_frozen_expired_invoices
# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import check_frozen_expired_invoices [as 别名]
def check_frozen_expired_invoices(self):
if time.time() - float(settings.get(bank_settings.SETTINGS_LAST_FROZEN_EXPIRED_CHECK_KEY, 0)) < bank_settings.FROZEN_INVOICE_EXPIRED_CHECK_TIMEOUT:
return
settings[bank_settings.SETTINGS_LAST_FROZEN_EXPIRED_CHECK_KEY] = str(time.time())
if not InvoicePrototype.check_frozen_expired_invoices():
return
self.logger.error('We have some expired frozen invoices. Please, check them and remove or find error.')
示例3: test_check_frozen_expired_invoices__exist
# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import check_frozen_expired_invoices [as 别名]
def test_check_frozen_expired_invoices__exist(self):
invoice = self.create_invoice(state=INVOICE_STATE.FROZEN)
InvoicePrototype._db_filter(id=invoice.id).update(
updated_at=datetime.datetime.now() - bank_settings.FROZEN_INVOICE_EXPIRED_TIME
)
self.assertTrue(InvoicePrototype.check_frozen_expired_invoices())
示例4: test_check_frozen_expired_invoices__wrong_time
# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import check_frozen_expired_invoices [as 别名]
def test_check_frozen_expired_invoices__wrong_time(self):
self.create_invoice(state=INVOICE_STATE.FROZEN)
self.assertFalse(InvoicePrototype.check_frozen_expired_invoices())