1
1
from graphql .core .type import (GraphQLBoolean , GraphQLFloat , GraphQLID ,
2
- GraphQLInt , GraphQLScalarType , GraphQLString )
2
+ GraphQLInt , GraphQLString )
3
3
4
4
from graphene .core .schema import Schema
5
5
6
- from ..scalars import ID , Boolean , Float , Int , Scalar , String
6
+ from ..scalars import ID , Boolean , Float , Int , String
7
7
8
8
schema = Schema ()
9
9
@@ -26,29 +26,3 @@ def test_id_scalar():
26
26
27
27
def test_float_scalar ():
28
28
assert schema .T (Float ()) == GraphQLFloat
29
-
30
-
31
- def test_custom_scalar ():
32
- import datetime
33
- from graphql .core .language import ast
34
-
35
- class DateTimeScalar (Scalar ):
36
- '''DateTimeScalar Documentation'''
37
- @staticmethod
38
- def serialize (dt ):
39
- return dt .isoformat ()
40
-
41
- @staticmethod
42
- def parse_literal (node ):
43
- if isinstance (node , ast .StringValue ):
44
- return datetime .datetime .strptime (
45
- node .value , "%Y-%m-%dT%H:%M:%S.%f" )
46
-
47
- @staticmethod
48
- def parse_value (value ):
49
- return datetime .datetime .strptime (value , "%Y-%m-%dT%H:%M:%S.%f" )
50
-
51
- scalar_type = schema .T (DateTimeScalar )
52
- assert isinstance (scalar_type , GraphQLScalarType )
53
- assert scalar_type .name == 'DateTimeScalar'
54
- assert scalar_type .description == 'DateTimeScalar Documentation'
0 commit comments