def test_does_not_override_existing_avatars(self): hugo = create(Builder('user').named('Hugo', 'Boss')) create_default_avatar(hugo.getId()) first_hash = self.portrait_md5(hugo.getId()) create_default_avatar(hugo.getId()) second_hash = self.portrait_md5(hugo.getId()) self.assertEquals(first_hash, second_hash, 'Existing portrait was overriden by default' ' portrait generator.')
def test_does_not_override_existing_avatars(self): hugo = create(Builder('user').named('Hugo', 'Boss')) create_default_avatar(hugo.getId()) first_hash = self.portrait_md5(hugo.getId()) create_default_avatar(hugo.getId()) second_hash = self.portrait_md5(hugo.getId()) self.assertEquals( first_hash, second_hash, 'Existing portrait was overriden by default' ' portrait generator.')
def test_creates_default_avatar_for_users_without_avatar(self): hugo = create(Builder('user').named('Hugo', 'Boss')) self.assertEquals(None, self.portrait_md5(hugo.getId())) create_default_avatar(hugo.getId()) self.assertTrue(self.portrait_md5(hugo.getId()))
def getPersonalPortraitWrapper(self, id=None, verifyPermission=0): create_default_avatar(id or self.getAuthenticatedMember().getId()) return getPersonalPortrait(self, id=id, verifyPermission=verifyPermission)