From 60239c867a04e770fd7b8f542773a617e149dc87 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 17 Dec 2020 13:01:08 -0800 Subject: [PATCH] Updates unit tests --- bookwyrm/tests/models/test_book_model.py | 2 +- bookwyrm/tests/models/test_fields.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bookwyrm/tests/models/test_book_model.py b/bookwyrm/tests/models/test_book_model.py index e8b310842..a52133eaf 100644 --- a/bookwyrm/tests/models/test_book_model.py +++ b/bookwyrm/tests/models/test_book_model.py @@ -62,7 +62,7 @@ class Book(TestCase): def test_get_edition_info(self): ''' text slug about an edition ''' - book = models.Book.objects.create(title='Test Edition') + book = models.Edition.objects.create(title='Test Edition') self.assertEqual(book.edition_info, '') book.physical_format = 'worm' diff --git a/bookwyrm/tests/models/test_fields.py b/bookwyrm/tests/models/test_fields.py index 81b1d528a..10c674d99 100644 --- a/bookwyrm/tests/models/test_fields.py +++ b/bookwyrm/tests/models/test_fields.py @@ -393,17 +393,19 @@ class ActivitypubFields(TestCase): ContentFile(output.getvalue()) ) - output = fields.image_serializer(user.avatar) + output = fields.image_serializer(user.avatar, alt='alt text') self.assertIsNotNone( re.match( r'.*\.jpg', output.url, ) ) + self.assertEqual(output.name, 'alt text') self.assertEqual(output.type, 'Image') instance = fields.ImageField() + output = fields.image_serializer(user.avatar, alt=None) self.assertEqual(instance.field_to_activity(user.avatar), output) responses.add(