'This routine loads up the SpatiaLite SQL file.'

def load_spatialite_sql(self):

    if (self.connection.ops.spatial_version[:2] >= (2, 4)):
        cur = self.connection._cursor()
        cur.execute('SELECT    InitSpatialMetaData()')
    else:
        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))
        with open(spatialite_sql, 'r') as sql_fh:
            cur = self.connection._cursor()
            cur.executescript(sql_fh.read())
