Jump to solution
Details

The Fix

pip install stripe==14.4.0a2

Based on closed stripe/stripe-python issue #405 · PR/commit linked

Open PR/Commit
@@ -22,7 +22,7 @@ cache: global: - PYCURL_SSL_LIBRARY=gnutls - - STRIPE_MOCK_VERSION=0.8.0 + - STRIPE_MOCK_VERSION=0.9.0
fix.md
Option A — Upgrade to fixed release\npip install stripe==14.4.0a2\nWhen NOT to use: This fix is not applicable if the behavior of deleted resources is expected to remain unchanged.\n\n

Why This Fix Works in Production

  • Trigger: AssertionError: <StripeObject id=this_is_a_fake_id_for_deleted_object at 0x7fe455f47e60> JSON: {
  • Mechanism: Tests incorrectly asserted that deleted resources remain instances of their original class
  • Why the fix works: Fix tests for deleted resources to correctly assert the behavior after deletion. (first fixed release: 14.4.0a2).
Production impact:
  • If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).

Why This Breaks in Prod

  • Shows up under Python 3.6 in real deployments (not just unit tests).
  • Tests incorrectly asserted that deleted resources remain instances of their original class
  • Surfaces as: ======================================================================

Proof / Evidence

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“Thanks @tmaxwell-stripe! @blueyed If you pull master, the test suite should now work as expected with the latest stripe-mock.”
@ob-stripe · 2018-03-13 · source
“Doh. Yeah, we might be seeing a few more of these as the OpenAPI spec's accuracy is tightened up.”
@brandur-stripe · 2018-03-12 · source
“@ob-stripe OK, I cut a new stripe-mock version v0.9.0 with the latest OpenAPI spec.”
@tmaxwell-stripe · 2018-03-12 · source
“Hey @blueyed, thanks for the report! It looks like the tests were (incorrectly) asserting that after deleting a resource, the resource would still be an…”
@ob-stripe · 2018-03-12 · source

Failure Signature (Search String)

  • AssertionError: <StripeObject id=this_is_a_fake_id_for_deleted_object at 0x7fe455f47e60> JSON: {

Error Message

Stack trace
error.txt
Error Message ------------- ====================================================================== FAIL: test_is_deletable (tests.api_resources.test_account.AccountExternalAccountsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "…/Vcs/stripe-python/tests/api_resources/test_account.py", line 193, in test_is_deletable self.assertIsInstance(resource, stripe.BankAccount) AssertionError: <StripeObject id=this_is_a_fake_id_for_deleted_object at 0x7fe455f47e60> JSON: { "deleted": true, "id": "this_is_a_fake_id_for_deleted_object" } is not an instance of <class 'stripe.api_resources.bank_account.BankAccount'> ====================================================================== FAIL: test_is_deletable (tests.api_resources.test_account.AccountTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "…/Vcs/stripe-python/tests/api_resources/test_account.py", line 95, in test_is_deletable '/v1/accounts/%s' % resource.id File "…/Vcs/stripe-python/tests/helper.py", line 68, in assert_requested return self.request_mock.assert_requested(*args, **kwargs) File "…/Vcs/stripe-python/tests/request_mock.py", line 83, in assert_requested raise exception File "…/Vcs/stripe-python/tests/request_mock.py", line 75, in assert_requested self.request_spy.assert_called_wit ... (truncated) ...

Environment

  • Python: 3.6

What Broke

Test suite fails with multiple assertion errors related to deleted resources.

Why It Broke

Tests incorrectly asserted that deleted resources remain instances of their original class

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install stripe==14.4.0a2

When NOT to use: This fix is not applicable if the behavior of deleted resources is expected to remain unchanged.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/stripe/stripe-python/pull/407

First fixed release: 14.4.0a2

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix is not applicable if the behavior of deleted resources is expected to remain unchanged.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
  • Pin production dependencies and upgrade only with a reproducible test that hits the failing path.

Version Compatibility Table

VersionStatus
14.4.0a2 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.