diff options
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r-- | archaeological_finds/tests.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index d0adc766a..c2979d074 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -958,6 +958,24 @@ class FindTest(FindInit, TestCase): find.save() find = models.Find.objects.get(pk=find.pk) self.assertEqual(find.external_id, "pat-12345-a1-new-label-too-hop") + # jinja 2 + profile.find_external_id = ( + "{{get_first_base_find__context_record__external_id}}-{{label}}-" + "{{label}}" + ) + profile.save() + find.save() + find = models.Find.objects.get(pk=find.pk) + self.assertEqual(find.external_id, "PAT-12345-A1-new-label-too-hop-hop") + # jinja 2 + custom filters + profile.find_external_id = ( + "{{get_first_base_find__context_record__external_id}}-{{label}}-" + "{{label}}||lower||deduplicate" + ) + profile.save() + find.save() + find = models.Find.objects.get(pk=find.pk) + self.assertEqual(find.external_id, "pat-12345-a1-new-label-too-hop") def testIndex(self): profile = get_current_profile() |