From 13ee55dfe8bea4c37ed3ecf0138d767d2d85a68c Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Sun, 30 Sep 2018 13:06:18 +0300 Subject: [PATCH] Add url to Post, Image and Comment entities --- federation/entities/base.py | 3 +++ federation/tests/entities/diaspora/test_utils.py | 1 + 2 files changed, 4 insertions(+) diff --git a/federation/entities/base.py b/federation/entities/base.py index 50f2671..35a2940 100644 --- a/federation/entities/base.py +++ b/federation/entities/base.py @@ -13,6 +13,7 @@ class Image(PublicMixin, OptionalRawContentMixin, CreatedAtMixin): linked_guid = "" height = 0 width = 0 + url = "" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -22,6 +23,7 @@ class Image(PublicMixin, OptionalRawContentMixin, CreatedAtMixin): class Comment(RawContentMixin, ParticipationMixin, CreatedAtMixin): """Represents a comment, linked to another object.""" participation = "comment" + url = "" _allowed_children = (Image,) @@ -40,6 +42,7 @@ class Follow(CreatedAtMixin, TargetIDMixin): class Post(RawContentMixin, PublicMixin, CreatedAtMixin, ProviderDisplayNameMixin): """Reflects a post, status message, etc, which will be composed from the message or to the message.""" location = "" + url = "" _allowed_children = (Image,) diff --git a/federation/tests/entities/diaspora/test_utils.py b/federation/tests/entities/diaspora/test_utils.py index 3558e75..ef3d1ef 100644 --- a/federation/tests/entities/diaspora/test_utils.py +++ b/federation/tests/entities/diaspora/test_utils.py @@ -17,6 +17,7 @@ class TestGetBaseAttributes: assert set(attrs) == { "created_at", "location", "provider_display_name", "public", "raw_content", "signature", "base_url", "actor_id", "id", "handle", "guid", "activity", "activity_id", + "url", } entity = Profile() attrs = get_base_attributes(entity).keys()