summaryrefslogtreecommitdiff
path: root/archaeological_context_records/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-04-02 16:38:18 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-17 13:21:27 +0200
commit4129fb1a79f4082466940c3d0b0ced7767697664 (patch)
treec67ac8afe2228a572272dcebe8853d5d82bad9af /archaeological_context_records/tests.py
parentaba701cfb26a9432cd306ba832a5357b0705ae01 (diff)
downloadIshtar-4129fb1a79f4082466940c3d0b0ced7767697664.tar.bz2
Ishtar-4129fb1a79f4082466940c3d0b0ced7767697664.zip
Tests: fix default conversion to str
Diffstat (limited to 'archaeological_context_records/tests.py')
-rw-r--r--archaeological_context_records/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py
index aa98d83a8..764750cf6 100644
--- a/archaeological_context_records/tests.py
+++ b/archaeological_context_records/tests.py
@@ -293,6 +293,7 @@ class ContextRecordTest(ContextRecordInit, TestCase):
cr.location = "I am heeere"
cr.save()
cr = models.ContextRecord.objects.get(pk=cr.pk)
+ self.assertIsNotNone(cr.search_vector)
for key in ('label', 'heeer'):
self.assertIn(key, cr.search_vector)
cr.operation.code_patriarche = "PATRIARCHE"
@@ -300,12 +301,14 @@ class ContextRecordTest(ContextRecordInit, TestCase):
cr = models.ContextRecord.objects.get(pk=cr.pk)
profile = get_current_profile()
+ self.assertIsNotNone(cr.cached_label)
self.assertIn(profile.operation_prefix.lower() + "patriarch",
cr.search_vector)
def test_upstream_cache_update(self):
cr = self.create_context_record()[0]
cr_pk = cr.pk
+ self.assertIsNotNone(cr.cached_label)
# OP2010 - 1 | A | 1 | CR 1
ope_id, parcel_sec, parcel_nb, cr_label = cr.cached_label.split(' | ')
self.assertEqual(ope_id, 'OP2010-1')
@@ -317,6 +320,7 @@ class ContextRecordTest(ContextRecordInit, TestCase):
cr.label = new_lbl
cr.save()
cr = models.ContextRecord.objects.get(pk=cr_pk)
+ self.assertIsNotNone(cr.cached_label)
ope_id, parcel_sec, parcel_nb, cr_label = cr.cached_label.split(' | ')
self.assertEqual(cr_label, new_lbl)
@@ -326,6 +330,7 @@ class ContextRecordTest(ContextRecordInit, TestCase):
parcel.parcel_number = new_nb
parcel.save()
cr = models.ContextRecord.objects.get(pk=cr_pk)
+ self.assertIsNotNone(cr.cached_label)
ope_id, parcel_sec, parcel_nb, cr_label = cr.cached_label.split(' | ')
self.assertEqual(parcel_sec, new_sec)
self.assertEqual(parcel_nb, new_nb)
@@ -333,6 +338,7 @@ class ContextRecordTest(ContextRecordInit, TestCase):
cr.operation.year = 2017
cr.operation.save()
cr = models.ContextRecord.objects.get(pk=cr_pk)
+ self.assertIsNotNone(cr.cached_label)
ope_id, parcel_sec, parcel_nb, cr_label = cr.cached_label.split(' | ')
self.assertEqual(ope_id, 'OP2017-1')