summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-02-02 16:36:58 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-02-02 16:36:58 +0100
commit79c236e7eef57bd4ebfda743db1354c99806ffa0 (patch)
tree70c4f45e2b70a8dcb3c9b59464731b1a0236d7f3
parent2ed9c95849853edbb39f484821b5df8f3a43ec50 (diff)
downloadIshtar-79c236e7eef57bd4ebfda743db1354c99806ffa0.tar.bz2
Ishtar-79c236e7eef57bd4ebfda743db1354c99806ffa0.zip
No more test with spatialite :( Too much cool PostgreSQL features used.
-rw-r--r--archaeological_context_records/models.py2
-rw-r--r--archaeological_context_records/tests.py4
-rw-r--r--archaeological_operations/models.py11
-rw-r--r--archaeological_operations/tests.py4
-rw-r--r--example_project/local_settings.py.gitlab-ci1
-rw-r--r--example_project/settings.py5
6 files changed, 2 insertions, 25 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 5e9d63652..e8cc60d43 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -467,8 +467,6 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem,
+ list(BaseFind.objects.filter(context_record=self).all())
def _cached_labels_bulk_update(self):
- if settings.TESTING and settings.USE_SPATIALITE_FOR_TESTS:
- return
self.base_finds.model.cached_label_bulk_update(
context_record_id=self.pk)
return True
diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py
index d93662a27..6ac1e6873 100644
--- a/archaeological_context_records/tests.py
+++ b/archaeological_context_records/tests.py
@@ -321,10 +321,6 @@ class ContextRecordTest(ContextRecordInit, TestCase):
self.assertEqual(ope_id, 'OP2017-1')
def test_downstream_cache_update(self):
- if settings.USE_SPATIALITE_FOR_TESTS:
- # using views - can only be tested with postgresql
- return
-
cr = self.create_context_record()[0]
from archaeological_finds.models import Find, BaseFind, MaterialType
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index d46d55089..14631bd10 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -489,8 +489,6 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,
return list(self.context_record.all())
def _cached_labels_bulk_update(self):
- if settings.TESTING and settings.USE_SPATIALITE_FOR_TESTS:
- return
self.context_record.model.cached_label_bulk_update(operation_id=self.pk)
return True
@@ -1470,13 +1468,8 @@ def parcel_post_save(sender, **kwargs):
return
if parcel.context_record.count():
- if settings.TESTING and settings.USE_SPATIALITE_FOR_TESTS:
- for cr in parcel.context_record.all():
- cr.skip_history_when_saving = True
- cr.save()
- else:
- parcel.context_record.model.cached_label_bulk_update(
- parcel_id=parcel.id)
+ parcel.context_record.model.cached_label_bulk_update(
+ parcel_id=parcel.id)
if parcel.operation and parcel.operation.pk and \
parcel.town not in list(parcel.operation.towns.all()):
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 6ad800e23..43dd57018 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -949,10 +949,6 @@ class OperationTest(TestCase, OperationInitTest):
self.assertIn(key, operation.search_vector)
def test_cache_bulk_update(self):
- if settings.USE_SPATIALITE_FOR_TESTS:
- # using views - can only be tested with postgresql
- return
-
operation = self.operations[0]
init_parcel = self.create_parcel()[0]
operation.parcels.add(init_parcel)
diff --git a/example_project/local_settings.py.gitlab-ci b/example_project/local_settings.py.gitlab-ci
index 913f10fea..b4f94f6a1 100644
--- a/example_project/local_settings.py.gitlab-ci
+++ b/example_project/local_settings.py.gitlab-ci
@@ -12,6 +12,5 @@ DATABASES = {
LOGFILE = '/tmp/ishtar.log'
PROJECT_SLUG = "CI-instance"
-USE_SPATIALITE_FOR_TESTS = False
SECRET_KEY = "not-so-secret-key"
diff --git a/example_project/settings.py b/example_project/settings.py
index 06e32ba58..7135f62f9 100644
--- a/example_project/settings.py
+++ b/example_project/settings.py
@@ -10,7 +10,6 @@ DEBUG_TOOLBAR = False
DEBUG_TO_CONSOLE = False
SQL_DEBUG = False
DJANGO_EXTENSIONS = False
-USE_SPATIALITE_FOR_TESTS = False
TEST_VIEWS = True
if "test" in sys.argv:
@@ -260,10 +259,6 @@ except ImportError, e:
TESTING = sys.argv[1:2] == ['test']
-# if TESTING and USE_SPATIALITE_FOR_TESTS:
-# DATABASES['default']['ENGINE'] = \
-# 'django.contrib.gis.db.backends.spatialite'
-
PROJECT_SLUG = locals().get('PROJECT_SLUG', 'default')
if LOGFILE: