djangosnippets.org: Latest snippets tagged with 'assertNumQueries'https://djangosnippets.org/tags/assertnumqueries/2011-01-12T10:41:59.698608-06:00Fuzzy testing with assertNumQueries
2011-01-12T10:41:59.698608-06:00spookylukeyhttps://djangosnippets.org/snippets/2320/<p>Django 1.3 has an assertNumQueries method which will allows you to simply specify the number of queries you expect. Sometimes, however, specifying the exact number of queries is overkill, and makes the test too brittle. This code provides a way to make more forgiving tests.
</p>
<p>See http://lukeplant.me.uk/blog/posts/fuzzy-testing-with-assertnumqueries/
</p>
Freely redistributable