Skip to content
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

Add warning to call django.setup() when running tests outside of manage.py #2419

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/topics/testing/advanced.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@ automatically as part of the setup of ``./manage.py test``. You only
need to manually invoke this method if you're not using running your need to manually invoke this method if you're not using running your
tests via Django's test runner. tests via Django's test runner.


.. warning::

While not specific to testing, Django must be initialized when used
outside of ``manage.py``

>>> import django
>>> django.setup()


.. _other-testing-frameworks: .. _other-testing-frameworks:


Using different testing frameworks Using different testing frameworks
Expand Down