kopia lustrzana https://gitlab.com/jaywink/federation
Make guid mandatory for Profile
Not sure why it wasn't mandatory..merge-requests/130/head
rodzic
feb1f30cfa
commit
53e5572f6c
|
@ -229,11 +229,6 @@ class Profile(CreatedAtMixin, HandleMixin, RawContentMixin, PublicMixin, GUIDMix
|
||||||
tag_list = []
|
tag_list = []
|
||||||
public_key = ""
|
public_key = ""
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
super().__init__(*args, **kwargs)
|
|
||||||
# Don't require a guid for Profile
|
|
||||||
self._required.remove("guid")
|
|
||||||
|
|
||||||
def validate_email(self):
|
def validate_email(self):
|
||||||
if self.email:
|
if self.email:
|
||||||
validator = Email()
|
validator = Email()
|
||||||
|
|
|
@ -67,6 +67,7 @@ class TestProfileEntity(object):
|
||||||
entity = Profile(handle="bob@example.com", raw_content="foobar", email="foobar")
|
entity = Profile(handle="bob@example.com", raw_content="foobar", email="foobar")
|
||||||
entity.validate()
|
entity.validate()
|
||||||
|
|
||||||
def test_guid_is_not_mandatory(self):
|
def test_guid_is_mandatory(self):
|
||||||
entity = Profile(handle="bob@example.com", raw_content="foobar")
|
entity = Profile(handle="bob@example.com", raw_content="foobar")
|
||||||
entity.validate()
|
with pytest.raises(ValueError):
|
||||||
|
entity.validate()
|
||||||
|
|
Ładowanie…
Reference in New Issue