Skip to content

Commit 51d2a40

Browse files
committed
Test/support Django 2.1
1 parent f7aa67c commit 51d2a40

File tree

6 files changed

+132
-14
lines changed

6 files changed

+132
-14
lines changed

.travis.yml

+5-10
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ matrix:
2929
- { env: DJANGO=2.0, python: 3.5 }
3030
- { env: DJANGO=2.0 RUN_LIVE_TESTS=true, python: 3.6 }
3131
- { env: DJANGO=2.0, python: pypy3 }
32-
# Django 2.1 (prerelease): Python 3.5+
33-
#- { env: DJANGO=2.1, python: 3.5 }
34-
#- { env: DJANGO=2.1, python: 3.6 }
32+
# Django 2.1: Python 3.5, 3.6, or 3.7
33+
- { env: DJANGO=2.1, python: 3.5 }
34+
- { env: DJANGO=2.1, python: 3.6 }
35+
- { env: DJANGO=2.1, python: 3.7-dev }
36+
- { env: DJANGO=2.1, python: pypy3 }
3537
# Django development master (direct from GitHub source):
36-
- { env: DJANGO=master, python: 3.6 }
3738
- { env: DJANGO=master, python: 3.7-dev }
3839

3940
# Obsolete Django versions (no longer supported by Django)
@@ -51,12 +52,6 @@ matrix:
5152
- { env: DJANGO=1.10, python: 3.5 }
5253

5354
allow_failures:
54-
- env: DJANGO=2.1
55-
python: 3.5
56-
- env: DJANGO=2.1
57-
python: 3.6
58-
- env: DJANGO=master
59-
python: 3.6
6055
- env: DJANGO=master
6156
python: 3.7-dev
6257

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ built-in `django.core.mail` package. It includes:
4040
* Inbound message support, to receive email through your ESP's webhooks,
4141
with simplified, portable access to attachments and other inbound content
4242

43-
Anymail is released under the BSD license. It is extensively tested against Django 1.8--2.0
44-
(including Python 2.7, Python 3 and PyPy).
43+
Anymail is released under the BSD license. It is extensively tested against
44+
Django 1.8--2.1 (including Python 2.7, Python 3 and PyPy).
4545
Anymail releases follow `semantic versioning <http://semver.org/>`_.
4646

4747
.. END shared-intro

setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def long_description_from_readme(rst):
7070
"Programming Language :: Python :: 3.4",
7171
"Programming Language :: Python :: 3.5",
7272
"Programming Language :: Python :: 3.6",
73+
"Programming Language :: Python :: 3.7",
7374
"License :: OSI Approved :: BSD License",
7475
"Topic :: Communications :: Email",
7576
"Topic :: Software Development :: Libraries :: Python Modules",
@@ -80,6 +81,7 @@ def long_description_from_readme(rst):
8081
"Framework :: Django :: 1.10",
8182
"Framework :: Django :: 1.11",
8283
"Framework :: Django :: 2.0",
84+
"Framework :: Django :: 2.1",
8385
"Environment :: Web Environment",
8486
],
8587
long_description=long_description,

tests/test_settings/settings_2_1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Django settings for Anymail tests.
33
4-
Generated by 'django-admin startproject' using Django 2.1.dev20180313162727.
4+
Generated by 'django-admin startproject' using Django 2.1a1.
55
66
For more information on this file, see
77
https://docs.djangoproject.com/en/dev/topics/settings/

tests/test_settings/settings_2_2.py

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
"""
2+
Django settings for Anymail tests.
3+
4+
Generated by 'django-admin startproject' using Django 2.2.dev20180524181819.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/dev/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/dev/ref/settings/
11+
"""
12+
13+
import os
14+
15+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17+
18+
19+
# Quick-start development settings - unsuitable for production
20+
# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = 'NOT_FOR_PRODUCTION_USE'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
ALLOWED_HOSTS = []
29+
30+
31+
# Application definition
32+
33+
INSTALLED_APPS = [
34+
'django.contrib.admin',
35+
'django.contrib.auth',
36+
'django.contrib.contenttypes',
37+
'django.contrib.sessions',
38+
'django.contrib.messages',
39+
'django.contrib.staticfiles',
40+
'anymail',
41+
]
42+
43+
MIDDLEWARE = [
44+
'django.middleware.security.SecurityMiddleware',
45+
'django.contrib.sessions.middleware.SessionMiddleware',
46+
'django.middleware.common.CommonMiddleware',
47+
'django.middleware.csrf.CsrfViewMiddleware',
48+
'django.contrib.auth.middleware.AuthenticationMiddleware',
49+
'django.contrib.messages.middleware.MessageMiddleware',
50+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
51+
]
52+
53+
ROOT_URLCONF = 'tests.test_settings.urls'
54+
55+
TEMPLATES = [
56+
{
57+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
58+
'DIRS': [],
59+
'APP_DIRS': True,
60+
'OPTIONS': {
61+
'context_processors': [
62+
'django.template.context_processors.debug',
63+
'django.template.context_processors.request',
64+
'django.contrib.auth.context_processors.auth',
65+
'django.contrib.messages.context_processors.messages',
66+
],
67+
},
68+
},
69+
]
70+
71+
WSGI_APPLICATION = 'tests.wsgi.application'
72+
73+
74+
# Database
75+
# https://docs.djangoproject.com/en/dev/ref/settings/#databases
76+
77+
DATABASES = {
78+
'default': {
79+
'ENGINE': 'django.db.backends.sqlite3',
80+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
81+
}
82+
}
83+
84+
85+
# Password validation
86+
# https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators
87+
88+
AUTH_PASSWORD_VALIDATORS = [
89+
{
90+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
91+
},
92+
{
93+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
94+
},
95+
{
96+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
97+
},
98+
{
99+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
100+
},
101+
]
102+
103+
104+
# Internationalization
105+
# https://docs.djangoproject.com/en/dev/topics/i18n/
106+
107+
LANGUAGE_CODE = 'en-us'
108+
109+
TIME_ZONE = 'UTC'
110+
111+
USE_I18N = True
112+
113+
USE_L10N = True
114+
115+
USE_TZ = True
116+
117+
118+
# Static files (CSS, JavaScript, Images)
119+
# https://docs.djangoproject.com/en/dev/howto/static-files/
120+
121+
STATIC_URL = '/static/'

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ envlist =
1212
django19-py{27,34,35,py2}
1313
django18-py{34,35,py2}
1414
# ... then prereleases (if available):
15-
#django21-py{35,36}
15+
django21-py{35,36,37}
1616
djangoMaster-py{36,37}
1717

1818
[testenv]

0 commit comments

Comments
 (0)