X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/510a4d0c1e4496bee580f8a1dff2f3674fdb727c..e0164e6ca0588a270b77d892702e54ef62c31de2:/apps/catalogue/tests/book_import.py?ds=sidebyside diff --git a/apps/catalogue/tests/book_import.py b/apps/catalogue/tests/book_import.py index f65d8807a..f6110d0be 100644 --- a/apps/catalogue/tests/book_import.py +++ b/apps/catalogue/tests/book_import.py @@ -7,7 +7,7 @@ from catalogue import models from nose.tools import raises import tempfile -from os import unlink,path +from os import unlink, path, makedirs class BookImportLogicTests(WLTestCase): @@ -258,3 +258,13 @@ class BookImportGenerateTest(WLTestCase): parent = models.Book.from_xml_file(input) parent.build_pdf() self.assertTrue(path.exists(parent.pdf_file.path)) + + def test_custom_pdf(self): + out = models.get_dynamic_path(None, 'test-custom', ext='pdf') + absoulute_path = path.join(settings.MEDIA_ROOT, out) + + if not path.exists(path.dirname(absoulute_path)): + makedirs(path.dirname(absoulute_path)) + + self.book.build_pdf(customizations=['nofootnotes', '13pt', 'a4paper'], file_name='test-custom') + self.assertTrue(path.exists(absoulute_path))