title: Cleaning up a database in django before every test method
body: <p>By default when Django runs against sqlite backend it creates a new in memory database for a test. That means for every class that derives from unittest.TestCase, I get a new database. Can this be changed so that it is cleared before every test method is run?</p>
  
  <p>Example: I am testing a manager class that provides additional abstraction on top of Django persistent objects. The code looks more-less like that</p>
  
  <pre><code>class TestForManager(unittest.TestCase):
    def testAddingBlah(self):
      manager = Manager()
      self.assertEquals(manager.getBlahs(), 0)
      manager.addBlah(...)
      self.assertEquals(manager.getBlahs(), 1)
  
    def testAddingBlahInDifferentWay(self):
      manager = Manager()
      self.assertEquals(manager.getBlahs(), 0)
      manager.addBlahInDifferentWay(...)
      self.assertEquals(manager.getBlahs(), 1)
  </code></pre>
  
  <p>Now, the first assertion of second test fails, because the state of the database is preserved between test calls and there already is an instance of <code>Blah</code> in the database.</p>