예제 #1
0
 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.')
예제 #2
0
 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.')
예제 #3
0
 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()))
예제 #4
0
 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()))
예제 #5
0
 def getPersonalPortraitWrapper(self, id=None, verifyPermission=0):
     create_default_avatar(id or self.getAuthenticatedMember().getId())
     return getPersonalPortrait(self, id=id,
                                verifyPermission=verifyPermission)