forked from mirrors/bookwyrm
Correct test structure
This commit is contained in:
parent
39b2f37947
commit
9093170660
2 changed files with 2 additions and 2 deletions
|
@ -356,7 +356,7 @@ def image_serializer(value, alt):
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
if not url[:4] == "http":
|
if not url[:4] == "http":
|
||||||
url = "https://{:s}/{:s}".format(DOMAIN, url)
|
url = "https://{:s}{:s}".format(DOMAIN, url)
|
||||||
return activitypub.Document(url=url, name=alt)
|
return activitypub.Document(url=url, name=alt)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -429,7 +429,7 @@ class ActivitypubFields(TestCase):
|
||||||
def test_image_serialize(self):
|
def test_image_serialize(self):
|
||||||
"""make sure we're creating sensible image paths"""
|
"""make sure we're creating sensible image paths"""
|
||||||
ValueMock = namedtuple("ValueMock", ("url"))
|
ValueMock = namedtuple("ValueMock", ("url"))
|
||||||
value_mock = ValueMock("images/fish.jpg")
|
value_mock = ValueMock("/images/fish.jpg")
|
||||||
result = fields.image_serializer(value_mock, "hello")
|
result = fields.image_serializer(value_mock, "hello")
|
||||||
self.assertEqual(result.type, "Document")
|
self.assertEqual(result.type, "Document")
|
||||||
self.assertEqual(result.url, "https://your.domain.here/images/fish.jpg")
|
self.assertEqual(result.url, "https://your.domain.here/images/fish.jpg")
|
||||||
|
|
Loading…
Reference in a new issue