Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #17278 -- Enabled the spatialite GIS tests to run without havin…

…g to specify a database name in the settings. Thanks to Aymeric for the report and to Ramiro for the initial patch.
  • Loading branch information...
commit 675431dfaaa7fc9fbd89be2602332287489ee04f 1 parent cccbb6b
@jphalip jphalip authored
View
1  django/contrib/gis/db/backends/spatialite/creation.py
@@ -30,6 +30,7 @@ def create_test_db(self, verbosity=1, autoclobber=False):
self.connection.close()
self.connection.settings_dict["NAME"] = test_database_name
+ self.connection.ops.confirm_spatial_components_versions()
# Need to load the SpatiaLite initialization SQL before running `syncdb`.
self.load_spatialite_sql()
View
11 django/contrib/gis/db/backends/spatialite/operations.py
@@ -113,6 +113,12 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations):
def __init__(self, connection):
super(DatabaseOperations, self).__init__(connection)
+ # Creating the GIS terms dictionary.
+ gis_terms = ['isnull']
+ gis_terms += self.geometry_functions.keys()
+ self.gis_terms = dict([(term, None) for term in gis_terms])
+
+ def confirm_spatial_components_versions(self):
# Determine the version of the SpatiaLite library.
try:
vtup = self.spatialite_version_tuple()
@@ -129,11 +135,6 @@ def __init__(self, connection):
'SQL loaded on this database?' %
(self.connection.settings_dict['NAME'], msg))
- # Creating the GIS terms dictionary.
- gis_terms = ['isnull']
- gis_terms += list(self.geometry_functions)
- self.gis_terms = dict([(term, None) for term in gis_terms])
-
if version >= (2, 4, 0):
# Spatialite 2.4.0-RC4 added AsGML and AsKML, however both
# RC2 (shipped in popular Debian/Ubuntu packages) and RC4

0 comments on commit 675431d

Please sign in to comment.
Something went wrong with that request. Please try again.