Skip to content

Conversation

@christianmlong
Copy link
Member

I was thinking that I could use the db fixture to access a database connection object within a test. However, the db fixture returns None.

This documentation update makes it clear that the db fixture does not return an object, and explains that users should use from django.db import connection instead.

Reference:
See this comment on issue #338.

I was thinking that I could use the `db` fixture to access a database connection object within a test. However, the `db` fixture returns None. This documentation update makes it clear that the `db` fixture does not return an object, and explains that users should use from `django.db import connection` instead.

Reference:
See [this comment](#338 (comment)) on issue #338.
@blueyed
Copy link
Contributor

blueyed commented Mar 24, 2020

Thanks.

However, it could actually return the default connection maybe?

@bluetech
Copy link
Member

bluetech commented Oct 9, 2020

However, it could actually return the default connection maybe?

Regardless of this, the change itself looks good. Thanks @christianmlong.

@bluetech bluetech merged commit 625ff05 into master Oct 9, 2020
@bluetech bluetech deleted the db-fixture-doc-update branch October 9, 2020 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants