Skip to content

Commit 625ff05

Browse files
authored
Merge pull request #832 from pytest-dev/db-fixture-doc-update
Docs - explain how to get a db connection
2 parents 3f910b2 + b3a8a9e commit 625ff05

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/helpers.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,10 @@ is configured to be in the containing Django project.
231231
This fixture will ensure the Django database is set up. Only
232232
required for fixtures that want to use the database themselves. A
233233
test function should normally use the ``pytest.mark.django_db``
234-
mark to signal it needs the database.
234+
mark to signal it needs the database. This fixture does
235+
not return a database connection object. When you need a Django
236+
database connection or cursor, import it from Django using
237+
``from django.db import connection``.
235238

236239
``transactional_db``
237240
~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)