Skip trying to match editions
It's rare that it will be useful, and it was a huge hassle.
This commit is contained in:
parent
8b88de624d
commit
ccf3a4c5c1
3 changed files with 6 additions and 24 deletions
|
@ -24,8 +24,7 @@ class Book(TestCase):
|
|||
title="Example Work", remote_id="https://example.com/book/1"
|
||||
)
|
||||
self.first_edition = models.Edition.objects.create(
|
||||
title="Example Edition",
|
||||
parent_work=self.work,
|
||||
title="Example Edition", parent_work=self.work, isbn_10="1111111111"
|
||||
)
|
||||
self.second_edition = models.Edition.objects.create(
|
||||
title="Another Example Edition",
|
||||
|
@ -147,9 +146,11 @@ class Book(TestCase):
|
|||
def test_repair_edition(self):
|
||||
"""Fix editions with no works"""
|
||||
edition = models.Edition.objects.create(title="test")
|
||||
edition.authors.set([models.Author.objects.create(name="Author Name")])
|
||||
self.assertIsNone(edition.parent_work)
|
||||
|
||||
edition.repair()
|
||||
edition.refresh_from_db()
|
||||
|
||||
self.assertEqual(edition.parent_work.title, "test")
|
||||
self.assertEqual(edition.parent_work.authors.count(), 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue