def test_profile_avatar(self): profile(user=self.u, avatar='images/foo.png') eq_('%simages/foo.png' % settings.MEDIA_URL, profile_avatar(self.u))
def test_profile_avatar_default(self): profile(user=self.u) eq_(settings.DEFAULT_AVATAR, profile_avatar(self.u))
def test_profile_avatar_anonymous(self): eq_(settings.DEFAULT_AVATAR, profile_avatar(AnonymousUser()))
def test_profile_default_gravatar(self): ok_(urllib.urlencode({'d': settings.DEFAULT_AVATAR}) in profile_avatar(self.u), "Bad default avatar: %s" % profile_avatar(self.u))
def test_profile_avatar(self): self.u.email = '*****@*****.**' ok_(md5(self.u.email).hexdigest() in profile_avatar(self.u))
def test_profile_default_gravatar(self): d_param = urllib.urlencode({'d': settings.DEFAULT_AVATAR}) ok_(d_param in profile_avatar(self.u), "Bad default avatar: %s" % profile_avatar(self.u))
def test_profile_avatar_default(self): Profile.objects.create(user=self.u) eq_(settings.DEFAULT_AVATAR, profile_avatar(self.u))
def test_profile_avatar(self): profile = Profile(user=self.u) profile.avatar = 'images/foo.png' profile.save() eq_('%simages/foo.png' % settings.MEDIA_URL, profile_avatar(self.u))