django-commons / django-debug-toolbar

A configurable set of panels that display various debug information about the current request/response.
https://django-debug-toolbar.readthedocs.io
BSD 3-Clause "New" or "Revised" License
8.08k stars 1.05k forks source link

add self.assertNumQueries to test #1971

Closed crccheck closed 3 months ago

crccheck commented 3 months ago

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. Your commit message should include this information as well.

Fixes # (issue)

Checklist:

tim-schilling commented 3 months ago

@crccheck I think this is a WIP. I'm inclined to close it to keep the open PRs minimal until there's more of a direction for the work that requires discussion/review.

matthiask commented 3 months ago

I think there's some value in asserting how many quietus Django sees vs how many queries the toolbar sees. I think both functionalities use the same underlying data structure, which makes this additional assertion not very useful. Or maybe I'm missing something?

tim-schilling commented 3 months ago

@crccheck I'm going to close this. If you feel like this is important, please let us know why and we can reopen it.

crccheck commented 3 months ago

oh sorry, I only opened it to see if CI would run it. I figured out how a minimal command to get tests to run locally since then and I thought draft PRs wouldn't show up

crccheck commented 3 months ago

FYI @matthiask there's an issue where Django's queries actually don't match Debug Toolbar #1791 I was trying to recreate

I think there's some value in asserting how many quietus Django sees vs how many queries the toolbar sees. I think both functionalities use the same underlying data structure, which makes this additional assertion not very useful. Or maybe I'm missing something?

tim-schilling commented 3 months ago

Ah, that makes sense. Thanks for following up!