Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As you've discovered, Django's default test runner makes quite a few assumptions, including that it'll be able to create a new test database to run the tests against.</p> <p>If you need to override this or any of these default assumptions, you probably want to <a href="http://docs.djangoproject.com/en/1.1/topics/testing/#defining-a-test-runner" rel="nofollow noreferrer">write a custom test runner</a>. By doing so you'll have full control over exactly how tests are discovered, bootstrapped, and run.</p> <p>(If you're running Django's development trunk, or are looking forward to Django 1.2, note that defining custom test runners has recently gotten <a href="http://docs.djangoproject.com/en/dev/topics/testing/#topics-testing-test-runner" rel="nofollow noreferrer">quite a bit easier</a>.)</p> <p>If you poke around, you'll find a <a href="http://www.djangosnippets.org/snippets/705/" rel="nofollow noreferrer">few examples</a> of <a href="http://blog.jeffbalogh.org/post/57653515/nose-test-runner-for-django" rel="nofollow noreferrer">custom test runners</a> you could use to get started.</p> <p>Now, keep in mind that once you've taken control of test running you'll need to ensure that you someone meet the same assumptions about environment that Django's built-in runner does. In particular, you'll need to someone guarantee that whatever test database you'll use is a clean, fresh one for the tests -- you'll be quite unhappy if you try to run tests against a database with unpredictable contents.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload