title: Missing Table When Running Django Unittest with Sqlite3
body: <p>I'm trying to run a unittest with Django 1.3. Normally, I use MySQL as my database backend, but since this is painfully slow to spinup for a single unittest, I'm using Sqlite3.</p>
  
  <p>So to switch to Sqlite3 just for my unittests, in my settings.py I have:</p>
  
  <pre><code>import sys
  if 'test' in sys.argv:
      DATABASES = {
          'default': {
              'ENGINE': 'django.db.backends.sqlite3',
              'NAME':'/tmp/database.db',
              'USER'       : '',
              'PASSWORD' : '',
              'HOST'     : '',
          }
      }
  </code></pre>
  
  <p>When I run my unittest with <code>python manage.py test myapp.Test.test_myfunc</code>, I get the error:</p>
  
  <pre><code>DatabaseError: no such table: django_content_type
  </code></pre>
  
  <p>Googling shows there are a <a href="https://code.djangoproject.com/wiki/NewbieMistakes#DjangosaysUnabletoOpenDatabaseFilewhenusingSQLite3" rel="nofollow noreferrer">few</a> of <a href="http://www.pantz.org/software/sqlite/unabletoopendbsqliteerror.html" rel="nofollow noreferrer">possible</a> <a href="https://stackoverflow.com/questions/6157152/no-such-table-error-when-running-a-django-server-from-eclipse">reasons</a> for this <a href="https://stackoverflow.com/questions/4636970/sqlite3-operationalerror-unable-to-open-database-file">error</a>, none of which seem applicable to me. I'm not running Apache, so I don't see how permissions would be an issue. The file /tmp/database.db is being created, so /tmp is writable. The app django.contrib.contenttypes is included in my INSTALLED_APPS.</p>
  
  <p>What am I missing?</p>
  
  <p>Edit: I ran into this problem again in Django 1.5, but none of the proposed solutions work.</p>