mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Added CHANGELOG.rst
This commit is contained in:
parent
ec5de6229a
commit
449abb9037
2 changed files with 24 additions and 1 deletions
8
CHANGELOG.rst
Normal file
8
CHANGELOG.rst
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
Changelog
|
||||
=========
|
||||
|
||||
* 2.1 (not released)
|
||||
* Changed Gravatar link to use HTTPS by default
|
||||
* Fixed a bug where the admin list page should show the incorrect avatar
|
||||
* Updated render_primary view to accept usernames with @ signs in them
|
||||
* Updated translations (added Dutch, Japanese, and Simple Chinese)
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
import os.path
|
||||
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.test import TestCase
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from avatar.admin import AvatarAdmin
|
||||
from avatar.conf import settings
|
||||
from avatar.util import get_primary_avatar, get_user_model
|
||||
from avatar.models import Avatar
|
||||
|
|
@ -18,15 +20,28 @@ def upload_helper(o, filename):
|
|||
return response
|
||||
|
||||
|
||||
class AvatarUploadTests(TestCase):
|
||||
class AvatarTests(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.testdatapath = os.path.join(os.path.dirname(__file__), "data")
|
||||
self.user = get_user_model().objects.create_user('test', 'lennon@thebeatles.com', 'testpassword')
|
||||
self.user.save()
|
||||
self.client.login(username='test', password='testpassword')
|
||||
self.site = AdminSite()
|
||||
Image.init()
|
||||
|
||||
def testAdminGetAvatarReturnsDifferentImageTags(self):
|
||||
self.testNormalImageUpload()
|
||||
self.testNormalImageUpload()
|
||||
primary = Avatar.objects.get(primary=True)
|
||||
old = Avatar.objects.get(primary=False)
|
||||
|
||||
aa = AvatarAdmin(Avatar, self.site)
|
||||
primary_link = aa.get_avatar(primary)
|
||||
old_link = aa.get_avatar(old)
|
||||
|
||||
self.assertNotEqual(primary_link, old_link)
|
||||
|
||||
def testNonImageUpload(self):
|
||||
response = upload_helper(self, "nonimagefile")
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
|
|
|||
Loading…
Reference in a new issue