Skip to content

Commit fdeadf5

Browse files
Fix project setup (#1087)
* Fix project setup * Fix test_should_query_postgres_fields
1 parent 8324d47 commit fdeadf5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

graphene_django/compat.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ class MissingType(object):
66
# Postgres fields are only available in Django with psycopg2 installed
77
# and we cannot have psycopg2 on PyPy
88
from django.contrib.postgres.fields import (
9+
IntegerRangeField,
910
ArrayField,
1011
HStoreField,
1112
JSONField as PGJSONField,
1213
RangeField,
1314
)
1415
except ImportError:
15-
ArrayField, HStoreField, PGJSONField, RangeField = (MissingType,) * 4
16+
IntegerRangeField, ArrayField, HStoreField, PGJSONField, RangeField = (
17+
MissingType,
18+
) * 5
1619

1720
try:
1821
# JSONField is only available from Django 3.1

graphene_django/tests/test_query.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import graphene
1212
from graphene.relay import Node
1313

14-
from ..compat import JSONField, MissingType
14+
from ..compat import IntegerRangeField, MissingType
1515
from ..fields import DjangoConnectionField
1616
from ..types import DjangoObjectType
1717
from ..utils import DJANGO_FILTER_INSTALLED
@@ -114,7 +114,7 @@ def resolve_reporter(self, info):
114114
assert result.data == expected
115115

116116

117-
@pytest.mark.skipif(JSONField is MissingType, reason="RangeField should exist")
117+
@pytest.mark.skipif(IntegerRangeField is MissingType, reason="RangeField should exist")
118118
def test_should_query_postgres_fields():
119119
from django.contrib.postgres.fields import (
120120
IntegerRangeField,

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ use_parentheses=True
4545
line_length=88
4646

4747
[tool:pytest]
48-
DJANGO_SETTINGS_MODULE = django_test_settings
48+
DJANGO_SETTINGS_MODULE = examples.django_test_settings
4949
addopts = --random-order

0 commit comments

Comments
 (0)