当前位置: 首页>>代码示例>>Python>>正文


Python InvoicePrototype.get_unprocessed_invoice方法代码示例

本文整理汇总了Python中the_tale.finances.bank.prototypes.InvoicePrototype.get_unprocessed_invoice方法的典型用法代码示例。如果您正苦于以下问题:Python InvoicePrototype.get_unprocessed_invoice方法的具体用法?Python InvoicePrototype.get_unprocessed_invoice怎么用?Python InvoicePrototype.get_unprocessed_invoice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在the_tale.finances.bank.prototypes.InvoicePrototype的用法示例。


在下文中一共展示了InvoicePrototype.get_unprocessed_invoice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_get_unprocessed_invoice__no_invoice

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import get_unprocessed_invoice [as 别名]
    def test_get_unprocessed_invoice__no_invoice(self):
        for state in INVOICE_STATE.records:
            if state.is_REQUESTED or state.is_FORCED:
                continue
            self.create_invoice(state=state)

        self.assertEqual(InvoicePrototype.get_unprocessed_invoice(), None)
开发者ID:lshestov,项目名称:the-tale,代码行数:9,代码来源:test_prototypes.py

示例2: test_get_unprocessed_invoice_success

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import get_unprocessed_invoice [as 别名]
    def test_get_unprocessed_invoice_success(self):
        for state in INVOICE_STATE.records:
            if not (state.is_REQUESTED or state.is_FORCED):
                continue

            invoice = self.create_invoice(state=state)
            self.assertEqual(InvoicePrototype.get_unprocessed_invoice().id, invoice.id)
            InvoicePrototype._db_all().delete()
开发者ID:lshestov,项目名称:the-tale,代码行数:10,代码来源:test_prototypes.py

示例3: process_init_invoice

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import get_unprocessed_invoice [as 别名]
    def process_init_invoice(self):

        invoice = InvoicePrototype.get_unprocessed_invoice()

        if invoice is None:
            return

        if (not bank_settings.ENABLE_BANK or
            settings.get(bank_settings.SETTINGS_ALLOWED_KEY) is None):
            self.logger.info('postpone invoice %d' % invoice.id)
            return

        self.logger.info('process invoice %s' % invoice.id)

        if invoice.state.is_REQUESTED:
            invoice.freeze()
        elif invoice.state.is_FORCED:
            invoice.force()
        else:
            raise BankException('unknown invoice %d state %s' % (invoice.id, invoice.state))

        self.logger.info('invoice %s status %s' % (invoice.id, invoice.state))
开发者ID:,项目名称:,代码行数:24,代码来源:


注:本文中的the_tale.finances.bank.prototypes.InvoicePrototype.get_unprocessed_invoice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。