forked from mirrors/bookwyrm
Update Status Model Test
This commit is contained in:
parent
60e805ac2b
commit
bc7710a4a7
2 changed files with 7 additions and 7 deletions
|
@ -427,7 +427,7 @@ class ImageField(ActivitypubFieldMixin, models.ImageField):
|
||||||
"""returns an absolute URL for the image"""
|
"""returns an absolute URL for the image"""
|
||||||
name = getattr(value, self.name)
|
name = getattr(value, self.name)
|
||||||
if name is None:
|
if name is None:
|
||||||
return
|
return None
|
||||||
|
|
||||||
url = filepath_to_uri(name)
|
url = filepath_to_uri(name)
|
||||||
if url is not None:
|
if url is not None:
|
||||||
|
|
|
@ -177,7 +177,7 @@ class Status(TestCase):
|
||||||
self.assertEqual(activity["attachment"][0].type, "Document")
|
self.assertEqual(activity["attachment"][0].type, "Document")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
activity["attachment"][0].url,
|
activity["attachment"][0].url,
|
||||||
"https://%s%s" % (settings.DOMAIN, self.book.cover.url),
|
"https://%s%s" % (settings.MEDIA_FULL_URL, self.book.cover.url),
|
||||||
)
|
)
|
||||||
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ class Status(TestCase):
|
||||||
self.assertEqual(activity["attachment"][0].type, "Document")
|
self.assertEqual(activity["attachment"][0].type, "Document")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
activity["attachment"][0].url,
|
activity["attachment"][0].url,
|
||||||
"https://%s%s" % (settings.DOMAIN, self.book.cover.url),
|
"https://%s%s" % (settings.MEDIA_FULL_URL, self.book.cover.url),
|
||||||
)
|
)
|
||||||
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ class Status(TestCase):
|
||||||
self.assertEqual(activity["attachment"][0].type, "Document")
|
self.assertEqual(activity["attachment"][0].type, "Document")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
activity["attachment"][0].url,
|
activity["attachment"][0].url,
|
||||||
"https://%s%s" % (settings.DOMAIN, self.book.cover.url),
|
"https://%s%s" % (settings.MEDIA_FULL_URL, self.book.cover.url),
|
||||||
)
|
)
|
||||||
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ class Status(TestCase):
|
||||||
self.assertEqual(activity["attachment"][0].type, "Document")
|
self.assertEqual(activity["attachment"][0].type, "Document")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
activity["attachment"][0].url,
|
activity["attachment"][0].url,
|
||||||
"https://%s%s" % (settings.DOMAIN, self.book.cover.url),
|
"https://%s%s" % (settings.MEDIA_FULL_URL, self.book.cover.url),
|
||||||
)
|
)
|
||||||
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ class Status(TestCase):
|
||||||
self.assertEqual(activity["attachment"][0].type, "Document")
|
self.assertEqual(activity["attachment"][0].type, "Document")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
activity["attachment"][0].url,
|
activity["attachment"][0].url,
|
||||||
"https://%s%s" % (settings.DOMAIN, self.book.cover.url),
|
"https://%s%s" % (settings.MEDIA_FULL_URL, self.book.cover.url),
|
||||||
)
|
)
|
||||||
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ class Status(TestCase):
|
||||||
self.assertEqual(activity["attachment"][0].type, "Document")
|
self.assertEqual(activity["attachment"][0].type, "Document")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
activity["attachment"][0].url,
|
activity["attachment"][0].url,
|
||||||
"https://%s%s" % (settings.DOMAIN, self.book.cover.url),
|
"https://%s%s" % (settings.MEDIA_FULL_URL, self.book.cover.url),
|
||||||
)
|
)
|
||||||
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
self.assertEqual(activity["attachment"][0].name, "Test Edition")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue