@@ -365,12 +365,10 @@ def test_delete_subscription_with_schedule_releases_schedule_and_cancels_subscri
365365 ):
366366 with open ("./services/tests/samples/stripe_invoice.json" ) as f :
367367 stripe_invoice_response = json .load (f )
368- stripe_invoice_response ["data" ] = stripe_invoice_response ["data" ] * 2
369368 list_invoice_mock .return_value = stripe_invoice_response
370369 plan = PlanName .CODECOV_PRO_YEARLY .value
371370 stripe_subscription_id = "sub_1K77Y5GlVGuVgOrkJrLjRnne"
372371 stripe_schedule_id = "sub_sched_sch1K77Y5GlVGuVgOrkJrLjRnne"
373- charge = "ch_19yUQN2eZvKYlo2CQf7aWpSX"
374372 owner = OwnerFactory (
375373 stripe_subscription_id = stripe_subscription_id ,
376374 plan = plan ,
@@ -397,7 +395,7 @@ def test_delete_subscription_with_schedule_releases_schedule_and_cancels_subscri
397395 schedule_release_mock .assert_called_once_with (stripe_schedule_id )
398396 cancel_sub_mock .assert_called_once_with (stripe_subscription_id )
399397 list_invoice_mock .assert_called_once_with (subscription = stripe_subscription_id , status = "paid" )
400- create_refund_mock . assert_called_once_with ( charge = charge )
398+ self . assertEqual ( create_refund_mock . call_count , 2 )
401399 modify_customer_mock .assert_called_once_with (owner .stripe_customer_id , balance = 0 )
402400 modify_sub_mock .assert_not_called ()
403401
@@ -420,12 +418,10 @@ def test_delete_subscription_with_schedule_releases_schedule_and_cancels_subscri
420418 ):
421419 with open ("./services/tests/samples/stripe_invoice.json" ) as f :
422420 stripe_invoice_response = json .load (f )
423- stripe_invoice_response ["data" ] = stripe_invoice_response ["data" ] * 2
424421 list_invoice_mock .return_value = stripe_invoice_response
425422 plan = PlanName .CODECOV_PRO_YEARLY .value
426423 stripe_subscription_id = "sub_1K77Y5GlVGuVgOrkJrLjRnne"
427424 stripe_schedule_id = "sub_sched_sch1K77Y5GlVGuVgOrkJrLjRnne"
428- charge = "ch_19yUQN2eZvKYlo2CQf7aWpSX"
429425 owner = OwnerFactory (
430426 stripe_subscription_id = stripe_subscription_id ,
431427 plan = plan ,
@@ -452,7 +448,7 @@ def test_delete_subscription_with_schedule_releases_schedule_and_cancels_subscri
452448 schedule_release_mock .assert_called_once_with (stripe_schedule_id )
453449 cancel_sub_mock .assert_called_once_with (stripe_subscription_id )
454450 list_invoice_mock .assert_called_once_with (subscription = stripe_subscription_id , status = "paid" )
455- create_refund_mock . assert_called_once_with ( charge = charge )
451+ self . assertEqual ( create_refund_mock . call_count , 2 )
456452 modify_customer_mock .assert_called_once_with (owner .stripe_customer_id , balance = 0 )
457453 modify_sub_mock .assert_not_called ()
458454
0 commit comments