Skip to content

Commit 5e33ecd

Browse files
MisterGlassyairsilbermintz-aon
authored andcommitted
Fix test config & Replace additional methods removed in django 4.0
1 parent 9a00c8c commit 5e33ecd

File tree

7 files changed

+46
-25
lines changed

7 files changed

+46
-25
lines changed

.github/workflows/tests.yml

+24-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,31 @@ jobs:
88
strategy:
99
max-parallel: 4
1010
matrix:
11-
django: ["1.11", "2.2", "3.0", "3.1"]
12-
python-version: ["3.6", "3.7", "3.8"]
11+
django: ["2.2", "3.0", "3.1", "3.2", "4.0"]
12+
python-version: ["3.8", "3.9"]
1313
include:
14-
- django: "1.11"
15-
python-version: "2.7"
16-
14+
- django: "2.2"
15+
python-version: "3.6"
16+
- django: "2.2"
17+
python-version: "3.5"
18+
- django: "2.2"
19+
python-version: "3.7"
20+
- django: "3.0"
21+
python-version: "3.6"
22+
- django: "3.0"
23+
python-version: "3.7"
24+
- django: "3.1"
25+
python-version: "3.6"
26+
- django: "3.1"
27+
python-version: "3.7"
28+
- django: "3.2"
29+
python-version: "3.6"
30+
- django: "3.2"
31+
python-version: "3.7"
32+
- django: "3.2"
33+
python-version: "3.10"
34+
- django: "4.0"
35+
python-version: "3.10"
1736
steps:
1837
- uses: actions/checkout@v1
1938
- name: Set up Python ${{ matrix.python-version }}

graphene_django/tests/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import
22

33
from django.db import models
4-
from django.utils.translation import ugettext_lazy as _
4+
from django.utils.translation import gettext_lazy as _
55

66
CHOICES = ((1, "this"), (2, _("that")))
77

graphene_django/tests/test_converter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44
from django.db import models
5-
from django.utils.translation import ugettext_lazy as _
5+
from django.utils.translation import gettext_lazy as _
66
from py.test import raises
77

88
import graphene

graphene_django/tests/urls.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from django.conf.urls import url
1+
from django.urls import re_path
22

33
from ..views import GraphQLView
44

55
urlpatterns = [
6-
url(r"^graphql/batch", GraphQLView.as_view(batch=True)),
7-
url(r"^graphql", GraphQLView.as_view(graphiql=True)),
6+
re_path(r"^graphql/batch", GraphQLView.as_view(batch=True)),
7+
re_path(r"^graphql", GraphQLView.as_view(graphiql=True)),
88
]

graphene_django/tests/urls_inherited.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django.conf.urls import url
1+
from django.urls import re_path
22

33
from ..views import GraphQLView
44
from .schema_view import schema
@@ -10,4 +10,4 @@ class CustomGraphQLView(GraphQLView):
1010
pretty = True
1111

1212

13-
urlpatterns = [url(r"^graphql/inherited/$", CustomGraphQLView.as_view())]
13+
urlpatterns = [re_path(r"^graphql/inherited/$", CustomGraphQLView.as_view())]

graphene_django/tests/urls_pretty.py

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

33
from ..views import GraphQLView
44
from .schema_view import schema
55

6-
urlpatterns = [url(r"^graphql", GraphQLView.as_view(schema=schema, pretty=True))]
6+
urlpatterns = [re_path(r"^graphql", GraphQLView.as_view(schema=schema, pretty=True))]

tox.ini

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
[tox]
22
envlist =
3-
py{27,35,36,37,38}-django{111,20,21,22,master},
4-
py{36,37,38}-django{30,31},
3+
py{35,36,37,38,39}-django22,
4+
py{36,37,38,39}-django{30,31},
5+
py{36,37,38,39,310}-django32,
6+
py{38,39,310}-django{40,master},
57
black,flake8
68

79
[gh-actions]
810
python =
9-
2.7: py27
11+
3.5: py35
1012
3.6: py36
1113
3.7: py37
1214
3.8: py38
15+
3.9: py39
16+
3.10: py310
1317

1418
[gh-actions:env]
1519
DJANGO =
16-
1.11: django111
17-
2.0: django20
18-
2.1: django21
1920
2.2: django22
2021
3.0: django30
2122
3.1: django31
23+
3.2: django32
24+
3.2: django32
25+
4.0: django40
2226
master: djangomaster
2327

2428
[testenv]
@@ -29,13 +33,11 @@ setenv =
2933
deps =
3034
-e.[test]
3135
psycopg2-binary
32-
django111: Django>=1.11,<2.0
33-
django111: djangorestframework<3.12
34-
django20: Django>=2.0,<2.1
35-
django21: Django>=2.1,<2.2
3636
django22: Django>=2.2,<3.0
37-
django30: Django>=3.0a1,<3.1
37+
django30: Django>=3.0,<3.1
3838
django31: Django>=3.1,<3.2
39+
django32: Django>=3.2,<4
40+
django40: https://github.com/django/django/archive/refs/tags/4.0rc1.zip
3941
djangomaster: https://github.com/django/django/archive/master.zip
4042
commands = {posargs:py.test --cov=graphene_django graphene_django examples}
4143

0 commit comments

Comments
 (0)