fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test for parenthood by looking for children instead of HTML.
[wolnelektury.git]
/
apps
/
catalogue
/
tests
/
book_import.py
diff --git
a/apps/catalogue/tests/book_import.py
b/apps/catalogue/tests/book_import.py
index
09d0e1e
..
0d4f470
100644
(file)
--- a/
apps/catalogue/tests/book_import.py
+++ b/
apps/catalogue/tests/book_import.py
@@
-1,5
+1,8
@@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
-from __future__ import with_statement
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
+from django.conf import settings
from django.core.files.base import ContentFile, File
from catalogue.test_utils import *
from django.core.files.base import ContentFile, File
from catalogue.test_utils import *
@@
-418,7
+421,7
@@
class BookImportGenerateTest(WLTestCase):
self.book = models.Book.from_xml_file(xml)
def test_gen_pdf(self):
self.book = models.Book.from_xml_file(xml)
def test_gen_pdf(self):
- self.book.
build_pdf
()
+ self.book.
pdf_file.build
()
book = models.Book.objects.get(pk=self.book.pk)
self.assertTrue(path.exists(book.pdf_file.path))
book = models.Book.objects.get(pk=self.book.pk)
self.assertTrue(path.exists(book.pdf_file.path))
@@
-426,7
+429,7
@@
class BookImportGenerateTest(WLTestCase):
"""This book contains a child."""
xml = path.join(path.dirname(__file__), "files/fraszki.xml")
parent = models.Book.from_xml_file(xml)
"""This book contains a child."""
xml = path.join(path.dirname(__file__), "files/fraszki.xml")
parent = models.Book.from_xml_file(xml)
- parent.
build_pdf
()
+ parent.
pdf_file.build
()
parent = models.Book.objects.get(pk=parent.pk)
self.assertTrue(path.exists(parent.pdf_file.path))
parent = models.Book.objects.get(pk=parent.pk)
self.assertTrue(path.exists(parent.pdf_file.path))