from django.core.files.base import ContentFile
from catalogue.test_utils import BookInfoStub, PersonStub, info_args, WLTestCase
from catalogue.models import Book
from django.core.files.base import ContentFile
from catalogue.test_utils import BookInfoStub, PersonStub, info_args, WLTestCase
from catalogue.models import Book
parent = Book.from_text_and_meta(ContentFile(self.TEXT), self.parent,
overwrite=True)
self.assertEqual(parent_cover_changed.call_count, 0)
parent = Book.from_text_and_meta(ContentFile(self.TEXT), self.parent,
overwrite=True)
self.assertEqual(parent_cover_changed.call_count, 0)
# Now change cover in parent.
parent_cover_changed.reset_mock()
self.parent.cover_url = "http://example.com/other-cover.jpg"
# Now change cover in parent.
parent_cover_changed.reset_mock()
self.parent.cover_url = "http://example.com/other-cover.jpg"