  """
  SQL functions reference lists:
  http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html
  https://web.archive.org/web/20130407175746/http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.0.0.html
  http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html
  """
  import re
  import sys
 
</s> remove from django.db import connection
 </s> add  </s> remove from django.contrib.gis.db.backends.spatialite.base import DatabaseWrapper
from django.db import connection, models
from django.db.backends.signals import connection_created
 </s> add from django.db import models </s> remove                 # No `srtext` field in the `spatial_ref_sys` table in SpatiaLite < 4
                if not spatialite or connection.ops.spatial_version[0] >= 4:
                    self.assertTrue(srs.wkt.startswith(sd['srtext']))
 </s> add                 self.assertTrue(srs.wkt.startswith(sd['srtext'])) </s> remove 

def add_spatial_version_related_fields(sender, **kwargs):
    """
    Adds fields after establishing a database connection to prevent database
    operations at compile time.
    """
    if connection_created.disconnect(add_spatial_version_related_fields, sender=DatabaseWrapper):
        spatial_version = connection.ops.spatial_version[0]
        if spatial_version >= 4:
            SpatialiteSpatialRefSys.add_to_class('srtext', models.CharField(max_length=2048))
            SpatialiteGeometryColumns.add_to_class('type', models.IntegerField(db_column='geometry_type'))
        else:
            SpatialiteGeometryColumns.add_to_class('type', models.CharField(max_length=30))
connection_created.connect(add_spatial_version_related_fields, sender=DatabaseWrapper)
 </s> add 
  """
  SQL functions reference lists:

  https://web.archive.org/web/20130407175746/http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.0.0.html
  http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html
  """
  import re
  import sys
keep keep replace keep keep keep keep keep
 Fixed #25645 -- Dropped support for SpatiaLite < 4.0. 
django/contrib/gis/db/backends/spatialite/operations.py