'Creates a test database, prompting the user for confirmation if the
database already exists. Returns the name of the test database created.
This method is overloaded to load up the SpatiaLite initialization
SQL prior to calling the `syncdb` command.'

def create_test_db(self, verbosity=1, autoclobber=False):

    if (verbosity >= 1):
        print ("Creating    test    database    '%s'..." % self.connection.alias)
    test_database_name = self._create_test_db(verbosity, autoclobber)
    self.connection.close()
    self.connection.settings_dict['NAME'] = test_database_name
    can_rollback = self._rollback_works()
    self.connection.settings_dict['SUPPORTS_TRANSACTIONS'] = can_rollback
    self.load_spatialite_sql()
    call_command('syncdb', verbosity=verbosity, interactive=False, database=self.connection.alias)
    if settings.CACHE_BACKEND.startswith('db://'):
        from django.core.cache import parse_backend_uri
        (_, cache_name, _) = parse_backend_uri(settings.CACHE_BACKEND)
        call_command('createcachetable', cache_name)
    cursor = self.connection.cursor()
    return test_database_name
