@@ -1534,7 +1534,7 @@ def test_create_paypal_account_fail_need_email(self):
15341534 with self .assertRaises (HyperwalletException ) as exc :
15351535 self .api .createPayPalAccount ('token' , paypal_account_data )
15361536
1537- self .assertEqual (exc .exception .message , 'email is required' )
1537+ self .assertEqual (exc .exception .message , 'email or accountId is required' )
15381538
15391539 @mock .patch ('hyperwallet.utils.ApiClient._makeRequest' )
15401540 def test_create_paypal_account_success (self , mock_post ):
@@ -1549,6 +1549,19 @@ def test_create_paypal_account_success(self, mock_post):
15491549
15501550 self .assertTrue (response .email , paypal_account_data .get ('token' ))
15511551
1552+ @mock .patch ('hyperwallet.utils.ApiClient._makeRequest' )
1553+ def test_create_paypal_account_accountId_success (self , mock_post ):
1554+
1555+ paypal_account_data = {
1556+ 'transferMethodCountry' : 'test-transfer-method-country' ,
1557+ 'transferMethodCurrency' : 'test-transfer-method-currency' ,
1558+ 'accountId' : 'test-email'
1559+ }
1560+ mock_post .return_value = paypal_account_data
1561+ response = self .api .createPayPalAccount ('token' , paypal_account_data )
1562+
1563+ self .assertTrue (response .accountId , paypal_account_data .get ('token' ))
1564+
15521565 def test_update_paypal_account_fail_need_user_token (self ):
15531566
15541567 with self .assertRaises (HyperwalletException ) as exc :
0 commit comments