On Sunday, August 17, 2014 8:39:17 PM UTC+6, James Bennett wrote:
>
> Not sure about the feasibility, though; would you be willing to work up a
> rough implementation of it?
>
Implementation of the assertion is straightforward, because it can be a
direct copy of AssertNumQueries with:
self.tes
+1 - useful for user code that guards against accidental poor ORM usage.
On Monday, 18 August 2014 05:47:15 UTC+10, jdunck wrote:
>
> I use this method on my own test subclasses, and I find it useful as a
> tripwire: a cause for review and consideration, more than a hard error. Did
> the number
I use this method on my own test subclasses, and I find it useful as a
tripwire: a cause for review and consideration, more than a hard error. Did
the number of queries go up on this change? Is that reasonable or a
mistake? Have we blown the perf budget so we should refactor? Or maybe the
number sh
I am not so convinced, what would you put in as the upper limit? While
preventing n+1, it still requires you to know what n in this testcase is
and changing n can lead to funny errors. Currently we are documenting
(hopefully) how those query counts come together, so it's clear what's
happening
On Sunday 17 August 2014 17:36:12 Michael Manfre wrote:
> AssertNumQueries is often a problem for 3rd party backends.
> AssertMaxQueries would become the same and likely result in poorly written
> tests because of the inherent slop factor in the arbitrarily chosen max
> value.
>
I agree with the
I like the idea -- if nothing else, it would provide an easy way to have a
test suite discover N+1 problems, especially in templates.
Not sure about the feasibility, though; would you be willing to work up a
rough implementation of it?
--
You received this message because you are subscribed to t
AssertNumQueries is often a problem for 3rd party backends.
AssertMaxQueries would become the same and likely result in poorly written
tests because of the inherent slop factor in the arbitrarily chosen max
value.
I'm not opposed to Django adding this. I'm opposed to Django using it in
its own tes
I'm doing some refactoring of a Django app and I want to make sure that I
don't introduce any really poorly performing pages as a result of poor
queries.
I want to write a test that tries every registered URL and makes sure that
none of them has an excessive number of queries.
AssertNumQueries