Skip to content

Commit e613a88

Browse files
authored
Merge pull request #855 from michael-k/django-3.1
Run tests against Django 3.1
2 parents d200eec + 5ed3ea2 commit e613a88

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
env: TOXENV=py37-dj22-sqlite-xdist-coverage
3030
- python: 3.8
3131
env: TOXENV=py38-dj30-sqlite-xdist-coverage
32+
- python: 3.8
33+
env: TOXENV=py38-dj31-sqlite-xdist-coverage
3234

3335
# Explicitly test (older) pytest 4.1.
3436
- python: 3.7

pytest_django/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def _get_boolean_value(x, name, default=None):
240240
except KeyError:
241241
raise ValueError(
242242
"{} is not a valid value for {}. "
243-
"It must be one of {}." % (x, name, ", ".join(possible_values.keys()))
243+
"It must be one of {}.".format(x, name, ", ".join(possible_values.keys()))
244244
)
245245

246246

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def read(fname):
5555
'Framework :: Django :: 2.1',
5656
'Framework :: Django :: 2.2',
5757
'Framework :: Django :: 3.0',
58+
'Framework :: Django :: 3.1',
5859
'Intended Audience :: Developers',
5960
'License :: OSI Approved :: BSD License',
6061
'Operating System :: OS Independent',

tests/test_fixtures.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,16 @@ class MyCustomUser(AbstractUser):
516516
)
517517
django_testdir.create_app_file(
518518
"""
519-
from django.conf.urls import url
520519
from tpkg.app import views
521520
522-
urlpatterns = [url(r'admin-required/', views.admin_required_view)]
521+
try:
522+
from django.urls import path
523+
except ImportError:
524+
from django.conf.urls import url
525+
526+
urlpatterns = [url(r'admin-required/', views.admin_required_view)]
527+
else:
528+
urlpatterns = [path('admin-required/', views.admin_required_view)]
523529
""",
524530
"urls.py",
525531
)

tests/test_manage_py_scan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_django_project_found_invalid_settings_version(django_testdir, monkeypat
116116
"""Invalid DSM should not cause an error with --help or --version."""
117117
monkeypatch.setenv("DJANGO_SETTINGS_MODULE", "DOES_NOT_EXIST")
118118

119-
result = django_testdir.runpytest_subprocess("django_project_root", "--version")
119+
result = django_testdir.runpytest_subprocess("django_project_root", "--version", "--version")
120120
assert result.ret == 0
121121
result.stderr.fnmatch_lines(["*This is pytest version*"])
122122

tox.ini

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
envlist =
3-
py37-dj{30,22,21,20,111}-postgres
4-
py36-dj{30,22,21,20,111,110,19,18}-postgres
3+
py37-dj{31,30,22,21,20,111}-postgres
4+
py36-dj{31,30,22,21,20,111,110,19,18}-postgres
55
py35-dj{22,21,20,111,110,19,18}-postgres
66
py34-dj{20,111,110}-postgres
77
py27-dj{111,110}-{mysql_innodb,mysql_myisam,postgres}
@@ -12,8 +12,9 @@ envlist =
1212
extras = testing
1313
deps =
1414
djmaster: https://github.com/django/django/archive/master.tar.gz
15-
dj30: Django>=3.0a1,<3.1
16-
dj22: Django>=2.2a1,<2.3
15+
dj31: Django>=3.1rc1,<3.2
16+
dj30: Django>=3.0,<3.1
17+
dj22: Django>=2.2,<2.3
1718
dj21: Django>=2.1,<2.2
1819
dj20: Django>=2.0,<2.1
1920
dj111: Django>=1.11,<1.12

0 commit comments

Comments
 (0)