summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 6b200ef39..0c790bdd5 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -3656,6 +3656,24 @@ class DocumentTest(TestCase):
doc.operations.add(self.ope1)
self.assertEqual(doc.operations.count(), 0)
+ def test_generate_pdftoppm(self):
+ if not settings.PDFTOPPM_BINARY:
+ return
+ pdf_path = os.path.join(
+ settings.ROOT_PATH, "..", "ishtar_common", "tests", "simple.pdf"
+ )
+ doc = models.Document.objects.create(
+ title="Document",
+ associated_file=SimpleUploadedFile(
+ name="simple.pdf",
+ content=open(pdf_path, "rb").read(),
+ content_type="application/pdf",
+ )
+ )
+ doc.operations.add(self.ope1)
+ doc = models.Document.objects.get(id=doc.pk)
+ self.assertTrue(doc.image.path)
+
def test_create_with_parent(self):
doc = models.Document.objects.create(title="Parent document")
doc.operations.add(self.ope1)