Fixed tests.

This commit is contained in:
Syrus Akbary 2016-09-21 08:31:09 -07:00
parent aa86c27ea2
commit b72684192f

View File

@ -8,6 +8,9 @@ from .structures import NonNull
from .unmountedtype import UnmountedType from .unmountedtype import UnmountedType
base_type = type
def source_resolver(source, root, args, context, info): def source_resolver(source, root, args, context, info):
resolved = getattr(root, source, None) resolved = getattr(root, source, None)
if inspect.isfunction(resolved): if inspect.isfunction(resolved):
@ -30,7 +33,7 @@ class Field(OrderedType):
) )
assert not callable(default_value), ( assert not callable(default_value), (
'The default value can not be a function but received "{}".' 'The default value can not be a function but received "{}".'
).format(type(default_value)) ).format(base_type(default_value))
if required: if required:
type = NonNull(type) type = NonNull(type)