From 2f61567837dab3e2e7354d8b81e844596046cb2a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 12 Oct 2017 16:33:24 +0200 Subject: Search vectors manage integration of parent vectors (refs #2912) --- archaeological_context_records/tests.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'archaeological_context_records/tests.py') diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py index 89b15fbbf..029246235 100644 --- a/archaeological_context_records/tests.py +++ b/archaeological_context_records/tests.py @@ -273,6 +273,20 @@ class ContextRecordTest(ContextRecordInit, TestCase): cr.operation ) + def test_search_vector_update(self): + cr = self.create_context_record(force=True)[0] + cr = models.ContextRecord.objects.get(pk=cr.pk) + cr.label = "Label label" + cr.location = "I am heeere" + cr.save() + for key in ('label', 'heeer'): + self.assertIn(key, cr.search_vector) + cr.operation.code_patriarche = "PATRIARCHE" + cr.operation.save() + cr = models.ContextRecord.objects.get(pk=cr.pk) + self.assertIn(settings.ISHTAR_OPE_PREFIX.lower() + "patriarch", + cr.search_vector) + def test_upstream_cache_update(self): cr = self.create_context_record()[0] cr_pk = cr.pk -- cgit v1.2.3