8000 Merge branch 'master' of github.com:balanced/balanced-python · balanced/balanced-python@62514f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 62514f2

Browse files
author
Marc Sherry
committed
Merge branch 'master' of github.com:balanced/balanced-python
2 parents fcf2f08 + 214242e commit 62514f2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/acceptance_suite.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from __future__ import unicode_literals
33

44
import balanced
5+
import copy
56
import requests
67
import unittest
78

@@ -238,6 +239,24 @@ def test_transactions_invalid_funding_sources(self):
238239
self.assertEqual(the_exception.category_code,
239240
'illegal-credit')
240241

242+
def test_merchant_no_bank_account(self):
243+
mp = balanced.Marketplace.query.one()
244+
merchant_payload = copy.deepcopy(merchants.BUSINESS_MERCHANT)
245+
merchant_payload['tax_id'] = '123456789'
246+
247+
merchant = mp.create_merchant(
248+
'pauli@exclusion.com',
249+
merchant=merchant_payload,
250+
)
251+
# now try to credit
252+
amount = 10000
253+
buyer_account = self._find_buyer_account()
254+
buyer_account.debit(amount=amount)
255+
with self.assertRaises(requests.HTTPError) as exc:
256+
merchant.credit(amount)
257+
the_exception = exc.exception
258+
self.assertEqual(the_exception.status_code, 409)
259+
241260
def test_add_funding_destination_to_nonmerchant(self):
242261
mp = balanced.Marketplace.query.one()
243262
card_payload = dict(self.us_card_payload)

0 commit comments

Comments
 (0)
0