Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace assertNumQueries with more advanced queries checking #530

Open
kernicPanel opened this issue Dec 19, 2023 · 0 comments
Open

Replace assertNumQueries with more advanced queries checking #530

kernicPanel opened this issue Dec 19, 2023 · 0 comments

Comments

@kernicPanel
Copy link
Member

Feature Request

Is your feature request related to a problem or unsupported use case? Please describe.
Currently we have many self.assertNumQueries in our tests, but as we are working, we frenquently need to update the expected values.
Also, when a number of queries changes, we don't know which queries have been added or removed.

Describe the solution you'd like
We should try https://github.com/adamchainz/django-perf-rec which stores all queries performed in a file, and compares them with the actual ones.
This would avoid the need to update each values, and would give us a clear view on added or removed queries.

Discovery, Documentation, Adoption, Migration Strategy
As we often use random values in our factories, we may write more deterministic tests when we are using this library.

Do you want to work on it through a Pull Request?
👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant