6
6
Article , Editor , EmbeddedArticle , Player , Reporter ,
7
7
ProfessorMetadata , ProfessorVector , Publisher )
8
8
from .. import registry
9
+ from .. import advanced_types
9
10
from ..converter import convert_mongoengine_field
10
11
from ..fields import MongoengineConnectionField
11
12
from ..types import MongoengineObjectType
@@ -80,24 +81,33 @@ def test_should_map_convert_json():
80
81
def test_should_point_convert_field ():
81
82
graphene_type = convert_mongoengine_field (mongoengine .PointField ())
82
83
assert isinstance (graphene_type , graphene .Field )
84
+ assert graphene_type .type == advanced_types .PointFieldType
83
85
assert isinstance (graphene_type .type .type , graphene .String )
84
86
assert isinstance (graphene_type .type .coordinates , graphene .List )
85
87
86
88
87
89
def test_should_polygon_covert_field ():
88
90
graphene_type = convert_mongoengine_field (mongoengine .PolygonField ())
89
91
assert isinstance (graphene_type , graphene .Field )
92
+ assert graphene_type .type == advanced_types .PolygonFieldType
90
93
assert isinstance (graphene_type .type .type , graphene .String )
91
94
assert isinstance (graphene_type .type .coordinates , graphene .List )
92
95
93
96
94
97
def test_should_multipolygon_convert_field ():
95
98
graphene_type = convert_mongoengine_field (mongoengine .MultiPolygonField ())
96
99
assert isinstance (graphene_type , graphene .Field )
100
+ assert graphene_type .type == advanced_types .MultiPolygonFieldType
97
101
assert isinstance (graphene_type .type .type , graphene .String )
98
102
assert isinstance (graphene_type .type .coordinates , graphene .List )
99
103
100
104
105
+ def test_should_file_convert_field ():
106
+ graphene_type = convert_mongoengine_field (mongoengine .FileField ())
107
+ assert isinstance (graphene_type , graphene .Field )
108
+ assert graphene_type .type == advanced_types .FileFieldType
109
+
110
+
101
111
def test_should_field_convert_list ():
102
112
assert_conversion (mongoengine .ListField , graphene .List , field = mongoengine .StringField ())
103
113
@@ -297,8 +307,6 @@ class Meta:
297
307
298
308
299
309
def test_should_generic_reference_convert_union ():
300
- pass
301
- """
302
310
class A (MongoengineObjectType ):
303
311
304
312
class Meta :
@@ -318,4 +326,3 @@ class Meta:
318
326
Reporter ._fields ['generic_reference' ], registry .get_global_registry ())
319
327
assert isinstance (generic_reference_field , graphene .Field )
320
328
assert isinstance (generic_reference_field .type (), graphene .Union )
321
- """
0 commit comments