Counting calls to Django QuerySet methods
Yesterday, I spent some time working on a test that needed to verify the delete method was called a certain number of times for a Django model. In the past we have used the assertNumQueries() method, but it always comes with some flakiness/tediousness (especially if we have to worry about queries made by middleware and/or authentication […]