mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
Django 1.8 alpha 1 support
* Test on Python 2.7, 3.4, pypy. * Call super.setUpClass in DjrillAdminTests. https://docs.djangoproject.com/en/dev/releases/1.8/#overriding-setupclass-teardownclass-in-test-cases Also clear up some new PendingDeprecationWarnings, where the changes can easily remain compatible back to Django 1.3: * Remove deprecated django.conf.urls.patterns. (And match Django recommendations in our docs.) https://docs.djangoproject.com/en/dev/releases/1.8/#django-conf-urls-patterns * Remove deprecated SimpleTestCase.urls. (We've already back-ported @override_settings for testing older Django versions.) https://docs.djangoproject.com/en/dev/releases/1.8/#django-test-simpletestcase-urls
This commit is contained in:
@@ -7,6 +7,8 @@ import six
|
||||
|
||||
from djrill.tests.mock_backend import DjrillBackendMockAPITestCase
|
||||
|
||||
from .utils import override_settings
|
||||
|
||||
|
||||
def reset_admin_site():
|
||||
"""Return the Django admin globals to their original state"""
|
||||
@@ -15,14 +17,13 @@ def reset_admin_site():
|
||||
del sys.modules['djrill.admin'] # force autodiscover to re-import
|
||||
|
||||
|
||||
@override_settings(ROOT_URLCONF='djrill.tests.admin_urls')
|
||||
class DjrillAdminTests(DjrillBackendMockAPITestCase):
|
||||
"""Test the Djrill admin site"""
|
||||
|
||||
# These urls set up the DjrillAdminSite as suggested in the readme
|
||||
urls = 'djrill.tests.admin_urls'
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(DjrillAdminTests, cls).setUpClass()
|
||||
# Other test cases may muck with the Django admin site globals,
|
||||
# so return it to the default state before loading test_admin_urls
|
||||
reset_admin_site()
|
||||
|
||||
Reference in New Issue
Block a user