Make guid mandatory for Profile

Not sure why it wasn't mandatory..
merge-requests/130/head
Jason Robinson 2016-09-15 19:48:40 +03:00
rodzic feb1f30cfa
commit 53e5572f6c
2 zmienionych plików z 3 dodań i 7 usunięć

Wyświetl plik

@ -229,11 +229,6 @@ class Profile(CreatedAtMixin, HandleMixin, RawContentMixin, PublicMixin, GUIDMix
tag_list = []
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):
if self.email:
validator = Email()

Wyświetl plik

@ -67,6 +67,7 @@ class TestProfileEntity(object):
entity = Profile(handle="bob@example.com", raw_content="foobar", email="foobar")
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.validate()
with pytest.raises(ValueError):
entity.validate()