I'm writing tests for module which using Stripe for payment. And I'd like to make a mock for it to don't send queries to API. I use the next code for it, but still I have queries to API. I don't understand why? Such query appears at the Stripe log every time I'm running the test:
/v1/customers/cus_*********/subscription
There is my code:
@patch('stripe.Subscription.save')
def test_get_subscription_level(self, subscription_update):
subscription_update.return_value = self.convert_to_stripe_object({...})
# there is test code
What's the cause of this and how can I patch that query? Thanks for any help!
Aucun commentaire:
Enregistrer un commentaire