Skip to content


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

wants to merge 1 commit into from

3 participants


No description provided.


I think this should be added to the earlier script and be run before setup_test_environment. Alternatively, we could make setup_test_environment call setup(), but I don't think that's wise.

Does this have a ticket?


While this mention might be included in the final patch, we really need proper documentation in ref/applications.txt as noted in the ticket.

@timgraham timgraham closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 0 deletions.
  1. +9 −0 docs/topics/testing/advanced.txt
9 docs/topics/testing/advanced.txt
@@ -251,6 +251,15 @@ automatically as part of the setup of ``./ test``. You only
need to manually invoke this method if you're not using running your
tests via Django's test runner.
+.. warning::
+ While not specific to testing, Django must be initialized when used
+ outside of ````
+ >>> import django
+ >>> django.setup()
.. _other-testing-frameworks:
Using different testing frameworks
Something went wrong with that request. Please try again.