本文整理汇总了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')
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)