Start here. This is the direct spoken answer to practice first.
Overview
Verifies commit callbacks without confusing callback registration with durable external delivery.
transaction.on_commit registers work to run only after the surrounding transaction commits successfully. In a Django TestCase, the test transaction normally rolls back, so I use captureOnCommitCallbacks to assert registration and optionally execute the callbacks. I test that rollback does not produce the effect and that the callback receives stable identifiers rather than a mutable model instance. The database change and callback are separate assertions.