Skip to content

Commit

Permalink
Fix test config & Replace additional methods removed in django 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterGlass authored and yairsilbermintz-aon committed Dec 2, 2021
1 parent 9a00c8c commit 5e33ecd
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 25 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,31 @@ jobs:
strategy:
max-parallel: 4
matrix:
django: ["1.11", "2.2", "3.0", "3.1"]
python-version: ["3.6", "3.7", "3.8"]
django: ["2.2", "3.0", "3.1", "3.2", "4.0"]
python-version: ["3.8", "3.9"]
include:
- django: "1.11"
python-version: "2.7"

- django: "2.2"
python-version: "3.6"
- django: "2.2"
python-version: "3.5"
- django: "2.2"
python-version: "3.7"
- django: "3.0"
python-version: "3.6"
- django: "3.0"
python-version: "3.7"
- django: "3.1"
python-version: "3.6"
- django: "3.1"
python-version: "3.7"
- django: "3.2"
python-version: "3.6"
- django: "3.2"
python-version: "3.7"
- django: "3.2"
python-version: "3.10"
- django: "4.0"
python-version: "3.10"
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion graphene_django/tests/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import

from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

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

Expand Down
2 changes: 1 addition & 1 deletion graphene_django/tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from py.test import raises

import graphene
Expand Down
6 changes: 3 additions & 3 deletions graphene_django/tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.conf.urls import url
from django.urls import re_path

from ..views import GraphQLView

urlpatterns = [
url(r"^graphql/batch", GraphQLView.as_view(batch=True)),
url(r"^graphql", GraphQLView.as_view(graphiql=True)),
re_path(r"^graphql/batch", GraphQLView.as_view(batch=True)),
re_path(r"^graphql", GraphQLView.as_view(graphiql=True)),
]
4 changes: 2 additions & 2 deletions graphene_django/tests/urls_inherited.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.conf.urls import url
from django.urls import re_path

from ..views import GraphQLView
from .schema_view import schema
Expand All @@ -10,4 +10,4 @@ class CustomGraphQLView(GraphQLView):
pretty = True


urlpatterns = [url(r"^graphql/inherited/$", CustomGraphQLView.as_view())]
urlpatterns = [re_path(r"^graphql/inherited/$", CustomGraphQLView.as_view())]
4 changes: 2 additions & 2 deletions graphene_django/tests/urls_pretty.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.conf.urls import url
from django.urls import re_path

from ..views import GraphQLView
from .schema_view import schema

urlpatterns = [url(r"^graphql", GraphQLView.as_view(schema=schema, pretty=True))]
urlpatterns = [re_path(r"^graphql", GraphQLView.as_view(schema=schema, pretty=True))]
24 changes: 13 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
[tox]
envlist =
py{27,35,36,37,38}-django{111,20,21,22,master},
py{36,37,38}-django{30,31},
py{35,36,37,38,39}-django22,
py{36,37,38,39}-django{30,31},
py{36,37,38,39,310}-django32,
py{38,39,310}-django{40,master},
black,flake8

[gh-actions]
python =
2.7: py27
3.5: py35
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[gh-actions:env]
DJANGO =
1.11: django111
2.0: django20
2.1: django21
2.2: django22
3.0: django30
3.1: django31
3.2: django32
3.2: django32
4.0: django40
master: djangomaster

[testenv]
Expand All @@ -29,13 +33,11 @@ setenv =
deps =
-e.[test]
psycopg2-binary
django111: Django>=1.11,<2.0
django111: djangorestframework<3.12
django20: Django>=2.0,<2.1
django21: Django>=2.1,<2.2
django22: Django>=2.2,<3.0
django30: Django>=3.0a1,<3.1
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
django32: Django>=3.2,<4
django40: https://github.com/django/django/archive/refs/tags/4.0rc1.zip
djangomaster: https://github.com/django/django/archive/master.zip
commands = {posargs:py.test --cov=graphene_django graphene_django examples}

Expand Down

0 comments on commit 5e33ecd

Please sign in to comment.