UX improvement: calls on callbacks
The add method returns a BaseResponse, on which you can find calls using calls.
The add_callback method doesn't. Users can get calls from the generic RequestsMock object, but that requires searching for the right request, for which responses provides no native methods.
Solutions:
- Let
add_callbackreturnBaseResponse(probably not possible) - Add built-in way to search for calls on the
RequestsMockobject, preferably those belonging to a specific response
Found https://github.com/getsentry/responses?tab=readme-ov-file#assert-based-on-the-exact-url, which mostly does solution 2.
At the very least, I believe it should be documented that and why add_callback doesn't return a response.
At the very least, I believe it should be documented that and why add_callback doesn't return a response.
There isn't a good reason other than it didn't do it in the past and no-one submitted a pull request to change it.