-
Notifications
You must be signed in to change notification settings - Fork 346
With both db
and transactional_db
, database access might be denied for db
#126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
blueyed
added a commit
to blueyed/pytest-django
that referenced
this issue
Jul 8, 2014
Interesting edge case. Your suggestion is probably the best course, instead of not doing anything call the transactional setup if transactional is detected. |
blueyed
added a commit
to blueyed/pytest-django
that referenced
this issue
Jul 9, 2014
This adds a new helper method (`_django_db_fixture_helper`), which is being called from `db` and `transaction_db`. The intermediate helper function (in contrast to using an internal fixture) is necessary for setting up the `django_db` mark. Fixes pytest-dev#126
Thanks for your feedback. I have been affected by this before already probably, but only got confused back then. It turned out to be a bit more involving than I've expected, but there is a PR now to fix it. |
This was referenced Jul 9, 2014
beyondgeeks
pushed a commit
to beyondgeeks/django-pytest
that referenced
this issue
Sep 6, 2022
This adds a new helper method (`_django_db_fixture_helper`), which is being called from `db` and `transaction_db`. The intermediate helper function (in contrast to using an internal fixture) is necessary for setting up the `django_db` mark. Fixes pytest-dev/pytest-django#126
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have fixtures that use
db
andtransactional_db
, you might get aDatabase access not allowed, use the "django_db" mark to enable
error, if you use the fixture usingdb
before the one usingtransactional_db
.The reason is that
db
skips enabling the database, if it findstransactional_db
in the fixturenames.I will provide a failing test, but am not sure about how this should get fixed.
Maybe the transactional db setup should get triggered / called from the
db
fixture in this case?The text was updated successfully, but these errors were encountered: