Skip to content

Commit

Permalink
Try workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Apr 4, 2024
1 parent e898285 commit 4c6ddaf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions quicktest.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ def run_tests(self):

django.setup()

# Workaround

from django.contrib.gis.db.backends.spatialite.base import DatabaseWrapper

def prepare_database(self):
super(DatabaseWrapper, self).prepare_database()
with self.cursor() as cursor:
cursor.execute("SELECT InitSpatialMetaData(1)")

DatabaseWrapper.prepare_database = prepare_database

failures = DiscoverRunner().run_tests(self.apps, verbosity=1)
if failures: # pragma: no cover
sys.exit(failures)
Expand Down

0 comments on commit 4c6ddaf

Please sign in to comment.