This repository was archived by the owner on Jun 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -1584,14 +1584,21 @@ def test_has_unverified_initial_payment_method_no_payment_intent(
15841584 def test_has_unverified_initial_payment_method_payment_intent_succeeded (
15851585 self , invoice_retrieve_mock , payment_intent_retrieve_mock
15861586 ):
1587- subscription = Mock ()
1588- subscription .latest_invoice = "inv_123"
1589-
1590- class MockPaymentIntent :
1591- status = "succeeded"
1587+ subscription = stripe .Subscription .construct_from (
1588+ {"latest_invoice" : "inv_123" },
1589+ "sub_123"
1590+ )
15921591
1593- invoice_retrieve_mock .return_value = Mock (payment_intent = "pi_123" )
1594- payment_intent_retrieve_mock .return_value = MockPaymentIntent ()
1592+ invoice_retrieve_mock .return_value = stripe .Invoice .construct_from (
1593+ {"payment_intent" : "pi_123" },
1594+ "inv_123"
1595+ )
1596+ payment_intent_retrieve_mock .return_value = stripe .PaymentIntent .construct_from (
1597+ {
1598+ "status" : "succeeded"
1599+ },
1600+ "payment_intent_asdf"
1601+ )
15951602
15961603 handler = StripeWebhookHandler ()
15971604 result = handler ._has_unverified_initial_payment_method (subscription )
You can’t perform that action at this time.
0 commit comments