kopia lustrzana https://gitlab.com/jaywink/federation
Merge pull request #97 from jaywink/fix-diasporaprofile
Fix DiasporaProfile.from_basemerge-requests/130/head
commit
ebacea83b0
|
@ -1,5 +1,10 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
* Converting base entity `Profile` to `DiasporaProfile` for outbound sending missed two attributes, `image_urls` and `tag_list`. Those are now included so that the values transfer into the built payload.
|
||||||
|
|
||||||
## [0.14.1] - 2017-08-06
|
## [0.14.1] - 2017-08-06
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -294,6 +294,8 @@ class Profile(CreatedAtMixin, HandleMixin, OptionalRawContentMixin, PublicMixin,
|
||||||
location = ""
|
location = ""
|
||||||
nsfw = False
|
nsfw = False
|
||||||
public_key = ""
|
public_key = ""
|
||||||
|
image_urls = None
|
||||||
|
tag_list = None
|
||||||
|
|
||||||
_allowed_children = (Image,)
|
_allowed_children = (Image,)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import re
|
||||||
import arrow
|
import arrow
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from federation.entities.base import Post
|
from federation.entities.base import Post, Profile
|
||||||
from federation.entities.diaspora.utils import (
|
from federation.entities.diaspora.utils import (
|
||||||
get_base_attributes, get_full_xml_representation, format_dt, add_element_to_doc)
|
get_base_attributes, get_full_xml_representation, format_dt, add_element_to_doc)
|
||||||
|
|
||||||
|
@ -17,7 +17,12 @@ class TestGetBaseAttributes:
|
||||||
"created_at", "guid", "handle", "location", "provider_display_name", "public", "raw_content",
|
"created_at", "guid", "handle", "location", "provider_display_name", "public", "raw_content",
|
||||||
"signature",
|
"signature",
|
||||||
}
|
}
|
||||||
|
entity = Profile()
|
||||||
|
attrs = get_base_attributes(entity).keys()
|
||||||
|
assert set(attrs) == {
|
||||||
|
"created_at", "guid", "handle", "name", "email", "gender", "raw_content", "location", "public",
|
||||||
|
"nsfw", "public_key", "image_urls", "tag_list", "signature",
|
||||||
|
}
|
||||||
|
|
||||||
class TestGetFullXMLRepresentation:
|
class TestGetFullXMLRepresentation:
|
||||||
def test_returns_xml_document(self):
|
def test_returns_xml_document(self):
|
||||||
|
|
Ładowanie…
Reference in New Issue