0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
This commit is contained in:
Matt Westcott 2015-10-26 12:32:28 +00:00
parent 0deb2da1af
commit d1ef42fe9b

View File

@ -1,8 +1,13 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.test import TestCase, override_settings
from django.core.urlresolvers import reverse
from django.core import mail
from django.contrib.auth import get_user_model
from taggit.models import Tag
@ -41,6 +46,15 @@ class TestHome(TestCase, WagtailTestUtils):
self.assertIn('no-store', response['Cache-Control'])
self.assertIn('max-age=0', response['Cache-Control'])
def test_nonascii_email(self):
# Test that non-ASCII email addresses don't break the admin; previously these would
# cause a failure when generating Gravatar URLs
get_user_model().objects.create_superuser(username='snowman', email='☃@thenorthpole.com', password='password')
# Login
self.client.login(username='snowman', password='password')
response = self.client.get(reverse('wagtailadmin_home'))
self.assertEqual(response.status_code, 200)
class TestEditorHooks(TestCase, WagtailTestUtils):
def setUp(self):