Mocking own code should be avoided if possible, but it does not apply to external resources like database, http responses etc.
Mocking outbound HTTP calls is worthwhile, but thankfully most testing frameworks I've used (at least in Python world) make that pretty easy.