summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-10-12 13:02:59 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-10-12 13:02:59 +0200
commit0c75a8c1300338ce0a03d3a1bb57959f48eaaf1a (patch)
tree38f7b144f2083901d073dbc3a7c646f70f9e7096 /archaeological_operations/tests.py
parent7225e1fa34d36c687e66ac892bd41138ff91349d (diff)
downloadIshtar-0c75a8c1300338ce0a03d3a1bb57959f48eaaf1a.tar.bz2
Ishtar-0c75a8c1300338ce0a03d3a1bb57959f48eaaf1a.zip
Manage postgres index and vector searches (refs #2912)
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 0d6908374..91050dc1f 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -895,6 +895,21 @@ class OperationTest(TestCase, OperationInitTest):
self.assertEqual(ope_id, 'OP2011-1')
self.assertEqual(town, self.towns[0].name)
+ def test_search_vector_update(self):
+ operation = self.operations[0]
+ town = self.create_towns({'numero_insee': '12346', 'name': 'Daisy'})[-1]
+ operation.towns.add(town)
+ town = self.create_towns(
+ {'numero_insee': '12347', 'name': 'Dirty old'})[-1]
+ operation.towns.add(town)
+ operation = models.Operation.objects.get(pk=operation.pk)
+ operation.comment = u"Zardoz"
+ operation.code_patriarche = u"HUIAAA5"
+ operation.save()
+ for key in ('old', 'op2010', 'dirty', 'daisy', "'2010'", "zardoz",
+ "huiaaa5"):
+ 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