billing: Fix the BillingError description check in test.

The self.assertEqual statement won't get executed because
BillingError would be raised and the execution would exit
with block.
This commit is contained in:
Vishnu Ks 2018-08-09 14:08:21 +00:00 committed by Rishi Gupta
parent d32051b106
commit 4895637a5a
1 changed files with 1 additions and 2 deletions

View File

@ -273,10 +273,9 @@ class StripeTest(ZulipTestCase):
self.assertIsNone(extract_current_subscription(mock_customer_with_canceled_subscription())) self.assertIsNone(extract_current_subscription(mock_customer_with_canceled_subscription()))
def test_subscribe_customer_to_second_plan(self) -> None: def test_subscribe_customer_to_second_plan(self) -> None:
with self.assertRaises(BillingError) as context: with self.assertRaisesRegex(BillingError, 'subscribing with existing subscription'):
do_subscribe_customer_to_plan(mock_customer_with_subscription(), do_subscribe_customer_to_plan(mock_customer_with_subscription(),
self.stripe_plan_id, self.quantity, 0) self.stripe_plan_id, self.quantity, 0)
self.assertEqual(context.exception.description, 'subscribing with existing subscription')
def test_sign_string(self) -> None: def test_sign_string(self) -> None:
string = "abc" string = "abc"