File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 2
2
from __future__ import unicode_literals
3
3
4
4
import balanced
5
+ import copy
5
6
import requests
6
7
import unittest
7
8
@@ -238,6 +239,24 @@ def test_transactions_invalid_funding_sources(self):
238
239
self .assertEqual (the_exception .category_code ,
239
240
'illegal-credit' )
240
241
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
+
241
260
def test_add_funding_destination_to_nonmerchant (self ):
242
261
mp = balanced .Marketplace .query .one ()
243
262
card_payload = dict (self .us_card_payload )
You can’t perform that action at this time.
0 commit comments