mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
stripe: Make stripe.error stubs more similiar to stripe python lib.
This will also fix the error that is generated during the mypy 0.641 upgrade in PR #10691.
This commit is contained in:
@@ -175,7 +175,7 @@ class StripeTest(ZulipTestCase):
|
||||
@catch_stripe_errors
|
||||
def raise_invalid_request_error() -> None:
|
||||
raise stripe.error.InvalidRequestError(
|
||||
"Request req_oJU621i6H6X4Ez: No such token: x", None, json_body={})
|
||||
"message", "param", "code", json_body={})
|
||||
with self.assertRaises(BillingError) as context:
|
||||
raise_invalid_request_error()
|
||||
self.assertEqual('other stripe error', context.exception.description)
|
||||
@@ -819,7 +819,7 @@ class BillingProcessorTest(ZulipTestCase):
|
||||
log_row=entry1, state=BillingProcessor.DONE)
|
||||
Customer.objects.create(realm=get_realm('zulip'), stripe_customer_id='cust_1')
|
||||
with patch('corporate.lib.stripe.do_adjust_subscription_quantity',
|
||||
side_effect=stripe.error.StripeError('message', 'param', 'code', json_body={})):
|
||||
side_effect=stripe.error.StripeError('message', json_body={})):
|
||||
with self.assertRaises(BillingError):
|
||||
run_billing_processor_one_step(processor)
|
||||
mock_billing_logger_error.assert_called()
|
||||
|
||||
Reference in New Issue
Block a user