Index: src/mapservice/codegen/templates/__init__test.mustache
===================================================================
--- src/mapservice/codegen/templates/__init__test.mustache	(revision be25db184d7819f890921a7d9eb68683fba03b1f)
+++ src/mapservice/codegen/templates/__init__test.mustache	(revision 0200f6c2debc5bc1fc05b09e0632903363688153)
@@ -4,8 +4,14 @@
 from flask_cors import CORS
 from flask_testing import TestCase
+from sqlalchemy.event import listen
 
 from {{packageName}}.encoder import JSONEncoder
+from {{packageName}}.server_impl.database.Model import db, db_test_setup
 
-from {{packageName}}.server_impl.database.Model import db, db_test_setup
+def load_spatialite(dbapi_conn, connection_record):
+	print("enable spatial lite extension")
+	# From https://geoalchemy-2.readthedocs.io/en/latest/spatialite_tutorial.html
+	dbapi_conn.enable_load_extension(True)
+	dbapi_conn.load_extension('/usr/local/lib64/mod_spatialite')
 
 class BaseTestCase(TestCase):
@@ -25,4 +31,5 @@
 
 	def setUp(self):
+		listen(db.engine, 'connect', load_spatialite)
 		db.drop_all()
 		db_test_setup()
