def test_has_avatar(self):
        request = DummyRequest()
        request.user = None
        gravatar = Gravatar(request, 'http://localhost/default_gravatar.png')
        self.assertFalse(gravatar.has_avatar())

        request = DummyRequest()
        request.user = {'email': '*****@*****.**'}
        gravatar = Gravatar(request, 'http://localhost/default_gravatar.png')
        self.assertTrue(gravatar.has_avatar())
Beispiel #2
0
 def test_has_avatar_valid_user(self):
     request = DummyRequest()
     request.user = User(email='*****@*****.**')
     gravatar = Gravatar(request, 'http://localhost/default_gravatar.png')
     self.assertTrue(gravatar.has_avatar())
Beispiel #3
0
 def test_has_avatar_no_user(self):
     request = DummyRequest()
     request.user = None
     gravatar = Gravatar(request, 'http://localhost/default_gravatar.png')
     self.assertFalse(gravatar.has_avatar())