Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
87 changed files
with
2,584 additions
and
1,395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,53 @@ | ||
from graphql import ResolveInfo | ||
|
||
from .types.fields import Field, Integer, Float, String, Boolean, ID, JsonString, DateTime, Date, Time | ||
from .selections import Selection, ResolveInfo | ||
from .types.fields import ( | ||
Field, | ||
Integer, | ||
Float, | ||
String, | ||
Boolean, | ||
ID, | ||
JsonString, | ||
DateTime, | ||
Date, | ||
Time, | ||
) | ||
from .types import BaseType, Object, Enum, EnumValue, Union | ||
from .schema import Schema | ||
from .operation import Operation, InvalidOperation | ||
from .query import gql, ExecutionResult | ||
|
||
__all__ = ( | ||
# graphql | ||
'ResolveInfo', | ||
|
||
"Selection", | ||
"ResolveInfo", | ||
# fields | ||
'Field', | ||
'Integer', | ||
'Float', | ||
'String', | ||
'Boolean', | ||
'ID', | ||
'JsonString', | ||
'DateTime', | ||
'Date', | ||
'Time', | ||
|
||
"Field", | ||
"Integer", | ||
"Float", | ||
"String", | ||
"Boolean", | ||
"ID", | ||
"JsonString", | ||
"DateTime", | ||
"Date", | ||
"Time", | ||
# types | ||
'BaseType', | ||
'Object', | ||
'Enum', | ||
'EnumValue', | ||
'Union', | ||
|
||
'Operation', | ||
'InvalidOperation', | ||
'Schema', | ||
'gql', | ||
'ExecutionResult', | ||
"BaseType", | ||
"Object", | ||
"Enum", | ||
"EnumValue", | ||
"Union", | ||
"Operation", | ||
"InvalidOperation", | ||
"Schema", | ||
"gql", | ||
"ExecutionResult", | ||
) | ||
|
||
try: | ||
from slothql import django | ||
__all__ += ('django',) | ||
|
||
__all__ += ("django",) | ||
except ImportError as e: | ||
if str(e) != "No module named 'django'": | ||
raise |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import os | ||
|
||
BASE_DIR = os.path.dirname(__file__) | ||
TEMPLATE_DIRS = [ | ||
'templates/', | ||
] | ||
TEMPLATE_DIRS = ["templates/"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
from .views import GraphQLView | ||
from .types import Model | ||
from .types import Model, DjangoFilter | ||
|
||
__all__ = ( | ||
'GraphQLView', | ||
'Model', | ||
) | ||
__all__ = ("GraphQLView", "Model", "DjangoFilter") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import pytest | ||
from unittest import mock | ||
|
||
from django.db import models | ||
|
||
|
||
@pytest.fixture() | ||
def queryset(**kwargs): | ||
queryset_instance = mock.Mock( | ||
spec=models.QuerySet, | ||
side_effect=queryset, | ||
select_related=mock.Mock(side_effect=lambda *_: queryset_instance), | ||
prefetch_related=mock.Mock(side_effect=lambda *_: queryset_instance), | ||
filter=mock.Mock(side_effect=lambda **_: queryset_instance), | ||
__iter__=lambda self: iter(()), | ||
_iterable_class=models.query.ModelIterable, | ||
**kwargs, | ||
) | ||
return queryset_instance | ||
|
||
|
||
@pytest.fixture() | ||
def queryset_factory(): | ||
return queryset |
Oops, something went wrong.