title: Django: How to keep db structure without data after running tests?
body: <p>I want to use the <a href="https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-option---keepdb" rel="nofollow noreferrer">--keepdb</a> option that allow to keep the database after running tests, because in my case, the creation of the dabatase takes a while (but running tests is actualy fast)</p>
  
  <p>However, I would like to keep the database structure only, not the data.
  Each time a run tests, I need an empty database.</p>
  
  <p>I know I could use <code>tearDown</code> method to delete each object created, but it is a tedious and error-prone way to do.
  I just need to find a way to tell Django to flush the whole dabatase (not destroy it) at the end of the unit tests.</p>
  
  <p>I have thinking of making a very simple script that:</p>
  
  <ol>
  <li>Run the tests keeping the db: <code>manage.py test --keepdb</code></li>
  <li>run <code>manage.py flushdb --database test_fugodb</code></li>
  </ol>
  
  <p>However, with 2nd step, I got a <code>django.db.utils.ConnectionDoesNotExist: The connection test_fugodb doesn't exist</code>. What is the name of this test db? I took the one displayed when running tests:</p>
  
  <p>What's wrong?
  Thanks!</p>