summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2025-06-18 16:51:11 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-06-18 16:51:11 +0200
commit9b3d54257b5024393284f2b1002acdb09615a1f1 (patch)
tree68d1e5941c5874e8bbd4c1aff0430fcbf542411d /archaeological_operations
parentee67a4dd81390da2841d6e7c7bd81a39d27e099a (diff)
downloadIshtar-9b3d54257b5024393284f2b1002acdb09615a1f1.tar.bz2
Ishtar-9b3d54257b5024393284f2b1002acdb09615a1f1.zip
✨ Media exporter: naming template
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/tests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 385337213..068ec3057 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -4232,6 +4232,24 @@ class OperationExportMediaTest(TestCase, TestPermissionQuery, OperationInitTest)
exclude=[('operation_image_00002.png', True)]
)
+ def test_naming(self):
+ self.exporter.naming = "DOC-{{item_type}}-{{item.cached_label|slug}}"
+ self.exporter.cascade = True
+ self.exporter.save()
+ cr, find = self._add_find()
+ cr.documents.add(self.documents[0])
+ find.documents.add(self.documents[0])
+
+ c = Client()
+ c.login(username=self.username, password=self.password)
+ response = c.get(self.export_url)
+ self._test_files(
+ response,
+ [(f'DOC-operation-{slugify(self.operation.cached_label)}.png', True),
+ (f'DOC-contextrecord-{slugify(cr.cached_label)}.png', True),
+ (f'DOC-find-{slugify(find.cached_label)}.png', True)]
+ )
+
class LabelTest(TestCase, OperationInitTest):
fixtures = FILE_FIXTURES