'This routine loads up the SpatiaLite SQL file.'

def load_spatialite_sql(self):

    spatialite_sql = self.spatialite_init_file()
    if (not os.path.isfile(spatialite_sql)):
        raise ImproperlyConfigured(('Could    not    find    the    required    SpatiaLite    initialization    SQL    file    (necessary    for    testing):    %s' % spatialite_sql))
    sql_fh = open(spatialite_sql, 'r')
    try:
        cur = self.connection._cursor()
        cur.executescript(sql_fh.read())
    finally:
        sql_fh.close()
