- input = open(path.dirname(__file__) + '/but-w-butonierce-but-w-butonierce.xml')
- book = models.Book.from_text_and_meta(File(input), self.book_info, overwrite=True)
- book.build_pdf()
- self.assertTrue(path.exists(book.pdf_file.path))
-
- def test_gen_pdf_child(self):
- input = open(path.dirname(__file__) + "/fraszka-do-anusie.xml")
- book = models.Book.from_text_and_meta(File(input), self.book_info, overwrite=True)
- book.build_pdf()
- self.assertTrue(path.exists(book.pdf_file.path))
+ self.book.build_pdf()
+ self.assertTrue(path.exists(self.book.pdf_file.path))
+
+ def test_gen_pdf_parent(self):
+ """This book contains a child."""
+ input = path.join(path.dirname(__file__), "files/fraszki.xml")
+ parent = models.Book.from_xml_file(input)
+ parent.build_pdf()
+ self.assertTrue(path.exists(parent.pdf_file.path))