'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
    self.connection.features.confirm()
    self.load_spatialite_sql()
    call_command('syncdb', verbosity=verbosity, interactive=False, database=self.connection.alias)
    for cache_alias in settings.CACHES:
        cache = get_cache(cache_alias)
        if isinstance(cache, BaseDatabaseCache):
            from django.db import router
            if router.allow_syncdb(self.connection.alias, cache.cache_model_class):
                call_command('createcachetable', cache._table, database=self.connection.alias)
    cursor = self.connection.cursor()
    return test_database_name
