Updates unit tests

This commit is contained in:
Mouse Reeve 2020-12-17 13:01:08 -08:00
parent 530198adea
commit 60239c867a
2 changed files with 4 additions and 2 deletions

View file

@ -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'

View file

@ -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(