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


Python InvoicePrototype._db_count方法代码示例

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


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

示例1: test_process__processed

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import _db_count [as 别名]
    def test_process__processed(self):
        self.assertEqual(BankInvoicePrototype._db_count(), 0)

        invoice = self.create_invoice(worker_call_count=1)

        self.assertEqual(invoice.bank_invoice_id, None)

        invoice.process()

        invoice.reload()

        self.assertEqual(BankInvoicePrototype._db_count(), 1)

        self.assertTrue(invoice.state.is_PROCESSED)

        bank_invoice = BankInvoicePrototype._db_get_object(0)

        self.assertEqual(bank_invoice.id, invoice.bank_invoice_id)
        self.assertTrue(bank_invoice.recipient_type.is_GAME_ACCOUNT)
        self.assertEqual(bank_invoice.recipient_id, self.fabric.account_id)
        self.assertTrue(bank_invoice.sender_type.is_XSOLLA)
        self.assertEqual(bank_invoice.sender_id, 0)
        self.assertTrue(bank_invoice.state.is_FORCED)
        self.assertTrue(bank_invoice.currency.is_PREMIUM)
        self.assertTrue(bank_invoice.amount, int(self.fabric.payment_sum))
        self.assertEqual(bank_invoice.operation_uid, 'bank-xsolla')
开发者ID:,项目名称:,代码行数:28,代码来源:

示例2: test_process__test

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import _db_count [as 别名]
    def test_process__test(self):
        self.assertEqual(BankInvoicePrototype._db_count(), 0)

        invoice = self.create_invoice(worker_call_count=1, test='1')
        invoice.process()

        invoice.reload()

        self.assertEqual(BankInvoicePrototype._db_count(), 0)

        self.assertTrue(invoice.state.is_SKIPPED_BECOUSE_TEST)
开发者ID:,项目名称:,代码行数:13,代码来源:

示例3: test_success

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import _db_count [as 别名]
    def test_success(self):
        self.assertEqual(BankInvoicePrototype._db_count(), 0)
        response = self.post_ajax_json(url('shop:give-money', account=self.account.id), self.post_data(amount=5))
        self.assertEqual(BankInvoicePrototype._db_count(), 1)

        invoice = BankInvoicePrototype._db_get_object(0)

        self.assertTrue(invoice.recipient_type.is_GAME_ACCOUNT)
        self.assertEqual(invoice.recipient_id, self.account.id)
        self.assertTrue(invoice.sender_type.is_GAME_MASTER)
        self.assertEqual(invoice.sender_id, self.superuser.id)
        self.assertTrue(invoice.currency.is_PREMIUM)
        self.assertEqual(invoice.amount, 5)
        self.assertEqual(invoice.description_for_recipient, u'bla-bla')
        self.assertTrue(invoice.state.is_FORCED)

        self.check_ajax_ok(response)
开发者ID:Alkalit,项目名称:the-tale,代码行数:19,代码来源:test_requests.py

示例4: test_process__wait_confirmation__transaction_confirmed__with_referal

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import _db_count [as 别名]
    def test_process__wait_confirmation__transaction_confirmed__with_referal(self):
        self.invoice.state = INVOICE_STATE.CONFIRMED
        self.invoice.save()

        result, account_id, bundle_id = register_user('test_user_2', '[email protected]', '111111')
        self.account._model.referral_of_id = account_id
        self.account.save()

        self.task.state = self.task.RELATION.WAIT_TRANSACTION_CONFIRMATION

        self.assertEqual(self.task.process(main_task=mock.Mock()), POSTPONED_TASK_LOGIC_RESULT.SUCCESS)

        self.assertEqual(InvoicePrototype._db_count(), 2)

        referral_invoice = InvoicePrototype._db_get_object(1)

        self.assertTrue(referral_invoice.amount > 0)
        self.assertTrue(referral_invoice.amount < self.amount)
        self.assertEqual(referral_invoice.recipient_id, account_id)
        self.assertTrue(referral_invoice.state.is_FORCED)

        self.assertTrue(self.task.state.is_SUCCESSED)
开发者ID:Alkalit,项目名称:the-tale,代码行数:24,代码来源:base_buy_task.py

示例5: test_from_errors

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import _db_count [as 别名]
 def test_from_errors(self):
     self.check_ajax_error(self.client.post(url('shop:give-money', account=self.account.id), {'amount': 'x', 'description': u'bla-bla'}),
                           'form_errors')
     self.assertEqual(BankInvoicePrototype._db_count(), 0)
开发者ID:Alkalit,项目名称:the-tale,代码行数:6,代码来源:test_requests.py

示例6: test_unlogined

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import _db_count [as 别名]
 def test_unlogined(self):
     self.request_logout()
     self.check_ajax_error(self.post_ajax_json(url('shop:give-money', account=self.account.id), self.post_data()), 'common.login_required')
     self.assertEqual(BankInvoicePrototype._db_count(), 0)
开发者ID:Alkalit,项目名称:the-tale,代码行数:6,代码来源:test_requests.py

示例7: test_for_wront_account

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import _db_count [as 别名]
 def test_for_wront_account(self):
     self.check_ajax_error(self.client.post(url('shop:give-money', account='xxx'), self.post_data()), 'account.wrong_format')
     self.assertEqual(BankInvoicePrototype._db_count(), 0)
开发者ID:Alkalit,项目名称:the-tale,代码行数:5,代码来源:test_requests.py

示例8: test_for_fast_account

# 需要导入模块: from the_tale.finances.bank.prototypes import InvoicePrototype [as 别名]
# 或者: from the_tale.finances.bank.prototypes.InvoicePrototype import _db_count [as 别名]
 def test_for_fast_account(self):
     self.account.is_fast = True
     self.account.save()
     self.check_ajax_error(self.client.post(url('shop:give-money', account=self.account.id), self.post_data()), 'fast_account')
     self.assertEqual(BankInvoicePrototype._db_count(), 0)
开发者ID:Alkalit,项目名称:the-tale,代码行数:7,代码来源:test_requests.py


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