mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-26 01:50:34 +00:00
Adding test for sort_title population
This commit is contained in:
parent
a3013c6224
commit
6b39052fcc
1 changed files with 13 additions and 0 deletions
|
@ -132,3 +132,16 @@ class Book(TestCase):
|
||||||
self.assertIsNotNone(book.cover_bw_book_xlarge_jpg.url)
|
self.assertIsNotNone(book.cover_bw_book_xlarge_jpg.url)
|
||||||
self.assertIsNotNone(book.cover_bw_book_xxlarge_webp.url)
|
self.assertIsNotNone(book.cover_bw_book_xxlarge_webp.url)
|
||||||
self.assertIsNotNone(book.cover_bw_book_xxlarge_jpg.url)
|
self.assertIsNotNone(book.cover_bw_book_xxlarge_jpg.url)
|
||||||
|
|
||||||
|
def test_populate_sort_title(self):
|
||||||
|
"""The sort title should remove the initial article on save"""
|
||||||
|
books = (
|
||||||
|
models.Edition.objects.create(
|
||||||
|
title=f"{article} Test Edition", languages=[langauge]
|
||||||
|
)
|
||||||
|
for langauge, articles in settings.LANGUAGE_ARTICLES.items()
|
||||||
|
for article in article
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
all([book.sort_title == "Test Edition" for book in books])
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue