Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Merge branch 'develop' into feature/issue-1160-change-billing-api-to-…
Browse files Browse the repository at this point in the history
…set-transaction-types
  • Loading branch information
justinvdm committed Jan 26, 2015
2 parents 278c67d + db10af0 commit 6cca566
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions go/billing/django_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def load_account_credits(account, credit_amount):
# Create a new transaction
transaction = Transaction.objects.create(
account_number=account.account_number,
transaction_type=Transaction.TRANSACTION_TYPE_TOPUP,
credit_amount=credit_amount)

# Update the selected account's credit balance
Expand Down
7 changes: 6 additions & 1 deletion go/billing/tests/test_django_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def test_load_account_credits(self):
self.assertEqual(account.last_topup_balance, Decimal('10.0'))

[transaction] = Transaction.objects.filter(
account_number=self.account.account_number).all()
account_number=self.account.account_number)

self.assertEqual(transaction.status, Transaction.STATUS_COMPLETED)
self.assertEqual(transaction.credit_amount, Decimal('10.0'))

self.assertEqual(
transaction.transaction_type,
Transaction.TRANSACTION_TYPE_TOPUP)

0 comments on commit 6cca566

Please sign in to comment.