#14230
-
#django tracks all queries in the connection object only if `DEBUG=True`.
This is sometimes the exact thing you want in tests.
But tests are always executed with `DEBUG=False` https://docs.djangoproject.com/es/5.2//topics/testing/overview/#other-test-conditions
An option is to use `CaptureQueriesContext` to temporarily enable query tracking on a connection https://stackoverflow.com/a/60299392 17/07/2025 à 15:49