def test_empty_book(self):
book_text = "<utwor />"
book = models.Book.from_text_and_meta(ContentFile(book_text), self.book_info)
+ book.refresh_from_db()
self.assertEqual(book.title, "Default Book")
self.assertEqual(book.slug, "default-book")
"""
book = models.Book.from_text_and_meta(ContentFile(book_text), self.book_info)
+ book.refresh_from_db()
self.assertTrue(book.has_html_file())
def test_book_with_fragment(self):
"""
book = models.Book.from_text_and_meta(ContentFile(book_text), self.book_info)
+ book.refresh_from_db()
self.assertTrue(book.has_html_file())
self.assertEqual(book.fragments.count(), 1)