title: Execute Django Testcase Suite Manually
body: <p><strong>Scenario:</strong></p>
  
  <p>Suppose I have some python scripts that do maintenance on the DB, if I use unittest to run tests on those scripts then they will interact with the DB and clobber it. So I'm trying to find a way to use the native Django test suite which simulates the DB without clobbering the real one. From the docs it looks like you can run test scripts using <code>manage.py tests /path/to/someTests.py</code> but only on <code>Django &gt; v1.6</code> (I'm on <code>Django-Nonrel v1.5.5</code>).</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/3374658/how-do-i-run-a-django-testcase-manually-against-other-database">How do I run a django TestCase manually / against other database</a>, which talks about running individual test cases and it seems dated--it mentions <code>Django v1.2</code>. However, I'd like to manually kick off the <strong><em>entire suite</em></strong> of tests I've defined. Assume for now that I can't kick off the suite using <code>manage.py test myApp</code> (because that's not what I'm doing). I tried kicking off the tests using <code>unittest.main()</code>. This works with one drawback... it completely clobbers the database. <em>Thank goodness for backups.</em></p>
  
  <h1>someTest.py</h1>
  
  <pre><code>import unittest
  import myModule
  from django.test import TestCase
  
  class venvTest(TestCase): # some test
      def test_outside_venv(self):
          self.failUnlessRaises(EnvironmentError, myModule.main)
  
  if __name__ == '__main__':
      unittest.main() # this fires off all tests, with nasty side effect of
                      # totally clobbering the DB
  </code></pre>
  
  <p><strong>How can I run <code>python someTest.py</code> and get it to fire off all the testcases using the Django test runner?</strong></p>
  
  <p>I can't even get this to work:</p>
  
  <pre><code>&gt;&gt;&gt; venvTest.run()
  </code></pre>
  
  <h1>Update</h1>
  
  <p>Since it's been mentioned in the comments, I asked a similar but different question here: <a href="https://stackoverflow.com/questions/27681190/django-testing-external-script">django testing external script</a>. That question concerns using <code>manage.py test /someTestScript.py</code>. This question concerns firing off test cases or a test suite separately from <code>manage.py</code>.</p>