title: How to automatically create postgis database for Django testing?
body: <p>I'm trying to test my Django apps which run on a PostGIS database, by following the info in the <a href="http://docs.djangoproject.com/en/dev/topics/testing/" rel="nofollow noreferrer">Django testing docs</a>.</p>
  <p>Normally I create a new database by copying a template:</p>
  <p>(as user postgres)</p>
  <pre><code>createdb -T template_postgis -O lizard test_geodjango2
  </code></pre>
  <p>When I run <code>./manage.py test</code>, I get the following message:</p>
  <blockquote>
  <p>Creating test database...
  Got an error creating the test database: permission denied to create database</p>
  <p>Type 'yes' if you would like to try deleting the test database 'test_geodjango2', or 'no' to &gt; cancel:</p>
  </blockquote>
  <p>What's the best way to let the system create the database?</p>