From 7695f49eb8ecce08ba1c036f94416114710fd7b6 Mon Sep 17 00:00:00 2001
From: Michael Fladischer <fladi@debian.org>
Date: Thu, 8 Oct 2015 08:58:54 -0700
Subject: Use spatialite backend for tests.

 Some of the upstream tests are designed to test features only supported on a
 PostGIS enable database. To make the tests run with an embedded spatialite
 database, those tests are skipped if the database connection ist not done using
 the PostGIS driver.
 See the following URL for a compatibility matrix:
 https://docs.djangoproject.com/en/1.7/ref/contrib/gis/db-api/#compatibility-tables
Forwarded: not-needed

Patch-Name: spatialite.patch
---
 tests/settings.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tests/settings.py b/tests/settings.py
index 39b5df0..c628f97 100644
--- a/tests/settings.py
+++ b/tests/settings.py
@@ -7,15 +7,15 @@ TEMPLATE_DEBUG = DEBUG
 
 DATABASES = {
     'default': {
-        'ENGINE': 'django.contrib.gis.db.backends.postgis',
-        'NAME': 'django_restframework_gis',
-        'USER': 'postgres',
-        'PASSWORD': 'postgres',
-        'HOST': '',
-        'PORT': ''
+        'ENGINE': 'django.contrib.gis.db.backends.spatialite',
+        'NAME': 'test.db',
     },
 }
 
+# Support mod_spatialite:
+# https://code.djangoproject.com/ticket/23901
+SPATIALITE_LIBRARY_PATH = 'mod_spatialite'
+
 SECRET_KEY = 'fn)t*+$)ugeyip6-#txyy$5wf2ervc0d2n#h)qb)y5@ly$t*@w'
 
 INSTALLED_APPS = (
@@ -72,6 +72,8 @@ MEDIA_URL = '/media/'
 STATIC_ROOT = '%s/static/' % SITE_ROOT
 STATIC_URL = '/static/'
 
+ANONYMOUS_USER_ID=-1
+
 TEMPLATE_STRING_IF_INVALID = 'INVALID_TEMPLATE: %s END_INVALID_TEMPLATE'
 
 # local settings must be imported before test runner otherwise they'll be ignored
