diff --git a/ecommerce/extensions/payment/tests/processors/test_webhooks.py b/ecommerce/extensions/payment/tests/processors/test_webhooks.py index 28078816303..5d5d39b5f32 100644 --- a/ecommerce/extensions/payment/tests/processors/test_webhooks.py +++ b/ecommerce/extensions/payment/tests/processors/test_webhooks.py @@ -63,7 +63,6 @@ def setUp(self): "currency": "usd", "description": "EDX-100001", "metadata": { - "courses": "[{'course_id': 'course-v1:edX+DemoX+Demo_Course', 'course_name': 'edX Demonstration Course'}]", "order_number": "EDX-100001" }, "payment_intent": "pi_3OzUOMH4caH7G0X114tkIL0X", @@ -74,7 +73,6 @@ def setUp(self): }, "type": "afterpay_clearpay" }, - "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xTHM3UVNINGNhSDdHMFgxKOy4mLAGMgYXtd9MJi06LBZw14jVkz0vKozsqk2_q6lLrskTm5gm4anP-pVGppcQYWwfthMZIPXhKyn5", "shipping": { "address": { "city": "Beverly Hills", @@ -97,10 +95,6 @@ def setUp(self): "currency": "usd", "description": "EDX-100001", "latest_charge": "py_3OzUOMH4caH7G0X11OOKbfIk", - "metadata": { - "courses": "[{'course_id': 'course-v1:edX+DemoX+Demo_Course', 'course_name': 'edX Demonstration Course'}]", - "order_number": "EDX-100001" - }, "payment_method": "pm_1OzURzH4caH7G0X19vH5rGBT", "payment_method_configuration_details": { "id": "pmc_1LspDWH4caH7G0X1LXrN8QMJ", @@ -179,7 +173,8 @@ def test_handle_webhooks_payment(self): """ with mock.patch('ecommerce.extensions.analytics.utils.track_segment_event') as mock_track: with mock.patch('stripe.PaymentIntent.retrieve') as mock_retrieve: - with mock.patch('ecommerce.extensions.checkout.mixins.EdxOrderPlacementMixin.handle_post_order') as mock_post_order: + with mock.patch( + 'ecommerce.extensions.checkout.mixins.EdxOrderPlacementMixin.handle_post_order') as mock_post_order: mock_retrieve.return_value = { 'id': self.payment_intent['id'], 'client_secret': self.payment_intent['client_secret'], @@ -190,7 +185,9 @@ def test_handle_webhooks_payment(self): 'type': self.payment_intent['charges']['data'][0]['payment_method_details']['type'] }, } - self.processor_class(self.site).handle_webhooks_payment(RequestFactory(), self.payment_intent, 'afterpay_clearpay') + self.processor_class(self.site).handle_webhooks_payment( + RequestFactory(), self.payment_intent, 'afterpay_clearpay' + ) properties = { 'basket_id': self.basket.id, 'processor_name': 'stripe', @@ -199,4 +196,6 @@ def test_handle_webhooks_payment(self): 'success': True, } mock_post_order.assert_called_once() - mock_track.assert_called_once_with(self.basket.site, self.basket.owner, 'Payment Processor Response', properties) + mock_track.assert_called_once_with( + self.basket.site, self.basket.owner, 'Payment Processor Response', properties + )