forked from mirrors/bookwyrm
Updates unit tests
This commit is contained in:
parent
530198adea
commit
60239c867a
2 changed files with 4 additions and 2 deletions
|
@ -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'
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue