Closed qarlosh closed 8 months ago
This optional argument allows to filter the queries to take into account for the assertion.
It may be useful to check for the count of only certain queries. For example, a use case of mine is to skip SAVEPOINT queries by using:
NO_SAVEPOINT_PATTERN=r'(?!^(ROLLBACK TO |RELEASE )?SAVEPOINT [`"].+[`"]$)' ... with django_assert_num_queries(n, pattern=NO_SAVEPOINT_PATTERN): ...
It will be better to propose this change to Django's version first.
This optional argument allows to filter the queries to take into account for the assertion.
It may be useful to check for the count of only certain queries. For example, a use case of mine is to skip SAVEPOINT queries by using: