summaryrefslogtreecommitdiff
path: root/docs/topics
diff options
context:
space:
mode:
authorGarry Polley <garry.polley@c2fo.com>2019-09-17 20:18:02 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-12-20 08:07:36 +0100
commit0b698eaea611d3bafa86d6d81d9203b482600ccb (patch)
treec250d37d281006f88488304b6d1dbfdfaa1a573e /docs/topics
parentd216e67b0cf7b161c8f532ca742e87eb8cf98f4b (diff)
downloaddjango-0b698eaea611d3bafa86d6d81d9203b482600ccb.tar.gz
Added example of assertNumQueries() with "using" kwarg in testing topics docs.
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/testing/tools.txt9
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt
index 13ae83dc80..2556670904 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -1675,9 +1675,12 @@ your test suite.
``num`` database queries are executed.
If a ``"using"`` key is present in ``kwargs`` it is used as the database
- alias for which to check the number of queries. If you wish to call a
- function with a ``using`` parameter you can do it by wrapping the call with
- a ``lambda`` to add an extra parameter::
+ alias for which to check the number of queries::
+
+ self.assertNumQueries(7, using='non_default_db')
+
+ If you wish to call a function with a ``using`` parameter you can do it by
+ wrapping the call with a ``lambda`` to add an extra parameter::
self.assertNumQueries(7, lambda: my_function(using=7))