I did have unit tests, they didn't catch the bug though because the test used a synchronous callback (much easier to test) and real world code ran with async callback.
Re django using linting, it uses flake8, which is a nice tool... but misses lots of stuff pylint catches.