4 ms·
django_assert_num_queries is helpful for this as well -- basically any time I'm writing a test for something where I've spent time thinking about query efficien
by JackC 6y ago
django_assert_num_queries is helpful for this as well -- basically any time I'm writing a test for something where I've spent time thinking about query efficiency in the first place, I'll throw in an assert. (I actually use a homerolled version that can log the location of the queries with -v, but same idea.)
https://pytest-django.readthedocs.io/en/latest/helpers.html#django-assert-num-queries https://pytest-django.readthedocs.io/en/latest/helpers.html#...