def test_get_stored_refresh_token(self): """Test that the correct refresh token is getting fetched for the customer""" paypal_client.save_refresh_token( '*****@*****.**', 'ref_token_sample') refresh_token = paypal_client.get_stored_refresh_token( '*****@*****.**') self.assertEqual(refresh_token, 'ref_token_sample')
def test_get_stored_refresh_token(self): """Test that the correct refresh token is getting fetched for the customer""" paypal_client.save_refresh_token('*****@*****.**', 'ref_token_sample') refresh_token = paypal_client.get_stored_refresh_token( '*****@*****.**') self.assertEqual(refresh_token, 'ref_token_sample')
def test_remove_consent(self): """Test removing consent deletes stored refresh token""" paypal_client.save_refresh_token('*****@*****.**', 'ref_token_sample') refresh_token = paypal_client.get_stored_refresh_token('*****@*****.**') self.assertEqual(refresh_token, 'ref_token_sample') paypal_client.remove_consent('*****@*****.**') refresh_token = paypal_client.get_stored_refresh_token('*****@*****.**') self.assertEqual(refresh_token, None)
def test_charge_wallet_success(self, mock): mock.return_value = True paypal_client.save_refresh_token( '*****@*****.**', 'ref_token_sample') return_status, message = paypal_client.charge_wallet( self.transaction, '*****@*****.**', 'correlation_id', 'sale') self.assertEqual(return_status, True) self.assertIn("Charged customer [email protected] " + self.transaction["amount"]["total"], message)
def test_charge_wallet_success(self, mock): mock.return_value = True paypal_client.save_refresh_token('*****@*****.**', 'ref_token_sample') return_status, message = paypal_client.charge_wallet( self.transaction, '*****@*****.**', 'correlation_id', 'sale') self.assertEqual(return_status, True) self.assertIn( "Charged customer [email protected] " + self.transaction["amount"]["total"], message)
def test_remove_consent(self): """Test removing consent deletes stored refresh token""" paypal_client.save_refresh_token('*****@*****.**', 'ref_token_sample') refresh_token = paypal_client.get_stored_refresh_token( '*****@*****.**') self.assertEqual(refresh_token, 'ref_token_sample') paypal_client.remove_consent('*****@*****.**') refresh_token = paypal_client.get_stored_refresh_token( '*****@*****.**') self.assertEqual(refresh_token, None)