Add tests for maximum database queries #2091
Labels
effort: low
Should be doable in <4h
enhancement
This improves an existing feature
prio: low
Not urgent, can be resolved in the distant future.
Milestone
Motivation
At the moment, we only check the API result, not the time it takes to generate the correct API result.
It's still part of the manual development/reviewing process to detect changes which drastically decrease API performance.
Usually, database queries are the bottleneck for your API views, especially when some related field is not prefetched etc...
Proposed Solution
Add tests for all API views which define a reasonable maximum of database queries (maybe 10-20, depending on the view) and assert they are not exceeded.
This can be achieved by django_assert_max_num_queries:
The text was updated successfully, but these errors were encountered: