Skip to content

Commit 4584ba8

Browse files
authored
dj4 (#389)
1 parent 5297f00 commit 4584ba8

File tree

8 files changed

+31
-33
lines changed

8 files changed

+31
-33
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ ghostdriver.log
3131
.python-version
3232
.ruby-version
3333
.settings/
34+
.idea/
3435

3536
## generic files to ignore
3637
*~

.travis.yml

+10-14
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,33 @@ dist: bionic
44
matrix:
55
fast_finish: true
66
include:
7-
# Python 3.5
8-
- python: 3.5
9-
env: TOXENV=py35-django22
10-
11-
# Python 3.6
12-
- python: 3.6
13-
env: TOXENV=py36-django22,py36-django30
14-
157
# Python 3.7
168
- python: 3.7
17-
env: TOXENV=py37-django22,py37-django30,py37-preventxss
9+
env: TOXENV=py37-django22,py37-django31,py37-django32,py37-django40
1810

1911
# Python 3.8
2012
- python: 3.8
21-
env: TOXENV=py38-django22,py38-django30
13+
env: TOXENV=py38-django22,py38-django31,py38-django32,py38-django40
14+
15+
# Python 3.9
16+
- python: 3.9
17+
env: TOXENV=py39-django22,py39-django31,py39-django32,py39-django40
2218

2319
# Django Master
24-
- python: 3.6
25-
env: TOXENV=py36-djangomaster
2620
- python: 3.7
2721
env: TOXENV=py37-djangomaster
2822
- python: 3.8
2923
env: TOXENV=py38-djangomaster
24+
- python: 3.9
25+
env: TOXENV=py39-djangomaster
3026

3127
allow_failures:
32-
- python: 3.6
33-
env: TOXENV=py36-djangomaster
3428
- python: 3.7
3529
env: TOXENV=py37-djangomaster
3630
- python: 3.8
3731
env: TOXENV=py38-djangomaster
32+
- python: 3.9
33+
env: TOXENV=py39-djangomaster
3834

3935
# before_install:
4036
# Workaround for a permissions issue with Travis virtual machine images

post_office/admin.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
from django.db import models
55
from django.contrib import admin
66
from django.conf import settings
7-
from django.conf.urls import re_path
87
from django.core.exceptions import ValidationError
98
from django.core.mail.message import SafeMIMEText
109
from django.forms import BaseInlineFormSet
1110
from django.forms.widgets import TextInput
1211
from django.http.response import HttpResponse, HttpResponseNotFound
1312
from django.template import Context, Template
14-
from django.urls import reverse
13+
from django.urls import re_path, reverse
1514
from django.utils.html import format_html
1615
from django.utils.text import Truncator
1716
from django.utils.translation import gettext_lazy as _

post_office/test_settings.py

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
'django.template.context_processors.debug',
8080
'django.template.context_processors.i18n',
8181
'django.template.context_processors.media',
82+
'django.template.context_processors.request',
8283
'django.template.context_processors.static',
8384
'django.template.context_processors.tz',
8485
'django.contrib.messages.context_processors.messages',
@@ -103,3 +104,6 @@
103104
]
104105

105106
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'tests/static')]
107+
108+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
109+

post_office/test_urls.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from django.conf.urls import url
21
from django.contrib import admin
2+
from django.urls import re_path
33

44
urlpatterns = [
5-
url(r'^admin/', admin.site.urls),
5+
re_path(r'^admin/', admin.site.urls),
66
]

post_office/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from django.conf import settings
22
from django.core.exceptions import ValidationError
33
from django.core.files import File
4-
from django.utils.encoding import force_text
4+
from django.utils.encoding import force_str
55

66
from post_office import cache
77
from .models import Email, PRIORITY, STATUS, EmailTemplate, Attachment
@@ -16,7 +16,7 @@ def send_mail(subject, message, from_email, recipient_list, html_message='',
1616
``send_mail`` core email method.
1717
"""
1818

19-
subject = force_text(subject)
19+
subject = force_str(subject)
2020
status = None if priority == PRIORITY.now else STATUS.queued
2121
emails = [
2222
Email.objects.create(

setup.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def run_tests(self):
4747
zip_safe=False,
4848
include_package_data=True,
4949
package_data={'': ['README.rst']},
50-
install_requires=['django>=2.2', 'jsonfield>=3.0'],
50+
install_requires=['django>=2.2', 'jsonfield>=3.0', 'bleach', 'pytz'],
5151
classifiers=[
5252
'Development Status :: 5 - Production/Stable',
5353
'Environment :: Web Environment',
@@ -58,10 +58,9 @@ def run_tests(self):
5858
'Programming Language :: Python',
5959
'Programming Language :: Python :: 3',
6060
'Programming Language :: Python :: 3 :: Only',
61-
'Programming Language :: Python :: 3.5',
62-
'Programming Language :: Python :: 3.6',
6361
'Programming Language :: Python :: 3.7',
6462
'Programming Language :: Python :: 3.8',
63+
'Programming Language :: Python :: 3.9',
6564
'Topic :: Communications :: Email',
6665
'Topic :: Internet :: WWW/HTTP',
6766
'Topic :: Software Development :: Libraries :: Python Modules',

tox.ini

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[tox]
22
envlist =
3-
py{35,36,37}-django22
4-
py{36,37,38}-django30
5-
py{36,37,38}-django31
6-
py{36,37,38}-preventxss
7-
py{36,37,38}-djangomain
3+
py{37,38,39}-django22
4+
py{37,38,39}-django31
5+
py{37,38,39}-django32
6+
py{37,38,39}-django40
7+
py{38,39}-djangomain
88

99
[testenv]
1010
setenv =
@@ -13,16 +13,15 @@ setenv =
1313

1414
deps =
1515
django22: Django<3
16-
django30: Django<3.1
1716
django31: Django<3.2
18-
preventxss: Django
19-
preventxss: bleach
17+
django32: Django<4.0
18+
django40: Django<4.1
2019
djangomain: https://github.com/django/django/archive/main.tar.gz
2120

2221
whitelist_externals = which
2322

2423
commands =
2524
which python
2625
python -V
27-
which django-admin.py
28-
django-admin.py test post_office ./
26+
pip freeze | grep Django
27+
django-admin test post_office ./

0 commit comments

Comments
 (0)