diff --git a/tests/api_resources/radar/test_value_list.py b/tests/api_resources/radar/test_value_list.py index 8824c581e..2999c4c1d 100644 --- a/tests/api_resources/radar/test_value_list.py +++ b/tests/api_resources/radar/test_value_list.py @@ -49,3 +49,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/radar/value_lists/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.radar.ValueList.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/radar/value_lists/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True diff --git a/tests/api_resources/radar/test_value_list_item.py b/tests/api_resources/radar/test_value_list_item.py index b6ab749c1..86eb49c26 100644 --- a/tests/api_resources/radar/test_value_list_item.py +++ b/tests/api_resources/radar/test_value_list_item.py @@ -34,3 +34,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/radar/value_list_items/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.radar.ValueListItem.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/radar/value_list_items/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True diff --git a/tests/api_resources/terminal/test_location.py b/tests/api_resources/terminal/test_location.py index d4fc2d925..c7a590f91 100644 --- a/tests/api_resources/terminal/test_location.py +++ b/tests/api_resources/terminal/test_location.py @@ -60,3 +60,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/terminal/locations/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.terminal.Location.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/terminal/locations/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True diff --git a/tests/api_resources/terminal/test_reader.py b/tests/api_resources/terminal/test_reader.py index 3389b6108..9ff9ee42c 100644 --- a/tests/api_resources/terminal/test_reader.py +++ b/tests/api_resources/terminal/test_reader.py @@ -53,3 +53,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/terminal/readers/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.terminal.Reader.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/terminal/readers/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True diff --git a/tests/api_resources/test_account.py b/tests/api_resources/test_account.py index a9283ac47..7d1d6463e 100644 --- a/tests/api_resources/test_account.py +++ b/tests/api_resources/test_account.py @@ -80,6 +80,13 @@ def test_is_deletable(self, request_mock): ) assert resource.deleted is True + def test_can_delete(self, request_mock): + resource = stripe.Account.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/accounts/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True + def test_can_retrieve_no_id(self, request_mock): resource = stripe.Account.retrieve() request_mock.assert_requested("get", "/v1/account") diff --git a/tests/api_resources/test_apple_pay_domain.py b/tests/api_resources/test_apple_pay_domain.py index edd2c49ac..c32309837 100644 --- a/tests/api_resources/test_apple_pay_domain.py +++ b/tests/api_resources/test_apple_pay_domain.py @@ -32,3 +32,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/apple_pay/domains/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.ApplePayDomain.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/apple_pay/domains/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True diff --git a/tests/api_resources/test_coupon.py b/tests/api_resources/test_coupon.py index c6bf7b859..4b8be4260 100644 --- a/tests/api_resources/test_coupon.py +++ b/tests/api_resources/test_coupon.py @@ -54,3 +54,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/coupons/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.Coupon.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/coupons/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True diff --git a/tests/api_resources/test_ephemeral_key.py b/tests/api_resources/test_ephemeral_key.py index 75df4d5ee..8764479b5 100644 --- a/tests/api_resources/test_ephemeral_key.py +++ b/tests/api_resources/test_ephemeral_key.py @@ -30,3 +30,11 @@ def test_is_deletable(self, request_mock): request_mock.assert_requested( "delete", "/v1/ephemeral_keys/%s" % resource.id ) + assert isinstance(resource, stripe.EphemeralKey) + + def test_can_delete(self, request_mock): + resource = stripe.EphemeralKey.delete("ephkey_123") + request_mock.assert_requested( + "delete", "/v1/ephemeral_keys/ephkey_123" + ) + assert isinstance(resource, stripe.EphemeralKey) diff --git a/tests/api_resources/test_invoice.py b/tests/api_resources/test_invoice.py index 133bb7ac1..373e5655a 100644 --- a/tests/api_resources/test_invoice.py +++ b/tests/api_resources/test_invoice.py @@ -50,6 +50,13 @@ def test_is_deletable(self, request_mock): ) assert resource.deleted is True + def test_can_delete(self, request_mock): + resource = stripe.Invoice.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/invoices/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True + def test_can_finalize_invoice(self, request_mock): resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) resource = resource.finalize_invoice() diff --git a/tests/api_resources/test_invoice_item.py b/tests/api_resources/test_invoice_item.py index 149845416..e7579838b 100644 --- a/tests/api_resources/test_invoice_item.py +++ b/tests/api_resources/test_invoice_item.py @@ -35,6 +35,13 @@ def test_is_saveable(self, request_mock): "post", "/v1/invoiceitems/%s" % TEST_RESOURCE_ID ) + def test_can_delete(self, request_mock): + resource = stripe.InvoiceItem.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/invoiceitems/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True + def test_is_modifiable(self, request_mock): resource = stripe.InvoiceItem.modify( TEST_RESOURCE_ID, metadata={"key": "value"} diff --git a/tests/api_resources/test_plan.py b/tests/api_resources/test_plan.py index 5196a0a64..e2325611b 100644 --- a/tests/api_resources/test_plan.py +++ b/tests/api_resources/test_plan.py @@ -53,3 +53,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/plans/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.Plan.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/plans/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True diff --git a/tests/api_resources/test_product.py b/tests/api_resources/test_product.py index 99bccb336..f6b111d75 100644 --- a/tests/api_resources/test_product.py +++ b/tests/api_resources/test_product.py @@ -49,3 +49,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/products/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.Product.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/products/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True diff --git a/tests/api_resources/test_recipient.py b/tests/api_resources/test_recipient.py index d3a50dedb..33830befd 100644 --- a/tests/api_resources/test_recipient.py +++ b/tests/api_resources/test_recipient.py @@ -49,3 +49,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/recipients/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.Recipient.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/recipients/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True diff --git a/tests/api_resources/test_sku.py b/tests/api_resources/test_sku.py index 71aee57de..5a384d11a 100644 --- a/tests/api_resources/test_sku.py +++ b/tests/api_resources/test_sku.py @@ -48,3 +48,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/skus/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.SKU.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/skus/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True diff --git a/tests/api_resources/test_subscription.py b/tests/api_resources/test_subscription.py index f2349d017..649eb368e 100644 --- a/tests/api_resources/test_subscription.py +++ b/tests/api_resources/test_subscription.py @@ -50,6 +50,13 @@ def test_is_deletable(self, request_mock): ) assert isinstance(resource, stripe.Subscription) + def test_can_delete(self, request_mock): + resource = stripe.Subscription.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/subscriptions/%s" % TEST_RESOURCE_ID + ) + assert isinstance(resource, stripe.Subscription) + def test_can_delete_discount(self, request_mock): sub = stripe.Subscription.retrieve(TEST_RESOURCE_ID) sub.delete_discount() diff --git a/tests/api_resources/test_subscription_item.py b/tests/api_resources/test_subscription_item.py index 9cf931095..8dacee4f0 100644 --- a/tests/api_resources/test_subscription_item.py +++ b/tests/api_resources/test_subscription_item.py @@ -57,3 +57,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/subscription_items/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.SubscriptionItem.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/subscription_items/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True diff --git a/tests/api_resources/test_webhook_endpoint.py b/tests/api_resources/test_webhook_endpoint.py index 2a81a068d..9c9981057 100644 --- a/tests/api_resources/test_webhook_endpoint.py +++ b/tests/api_resources/test_webhook_endpoint.py @@ -51,3 +51,10 @@ def test_is_deletable(self, request_mock): "delete", "/v1/webhook_endpoints/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True + + def test_can_delete(self, request_mock): + resource = stripe.WebhookEndpoint.delete(TEST_RESOURCE_ID) + request_mock.assert_requested( + "delete", "/v1/webhook_endpoints/%s" % TEST_RESOURCE_ID + ) + assert resource.deleted is True