@@ -79,25 +79,9 @@ def test_object_type():
79
79
80
80
81
81
# Test Custom SQLAlchemyObjectType Implementation
82
- class CustomSQLAlchemyObjectType (six .with_metaclass (SQLAlchemyObjectTypeMeta , ObjectType )):
83
- @classmethod
84
- def is_type_of (cls , root , context , info ):
85
- return SQLAlchemyObjectType .is_type_of (root , context , info )
86
-
87
- @classmethod
88
- def get_query (cls , context ):
89
- return SQLAlchemyObjectType .get_query (context )
90
-
91
- @classmethod
92
- def get_node (cls , id , context , info ):
93
- return SQLAlchemyObjectType .get_node (id , context , info )
94
-
95
- @classmethod
96
- def resolve_id (self , args , context , info ):
97
- graphene_type = info .parent_type .graphene_type
98
- if is_node (graphene_type ):
99
- return self .__mapper__ .primary_key_from_instance (self )[0 ]
100
- return getattr (self , graphene_type ._meta .id , None )
82
+ class CustomSQLAlchemyObjectType (SQLAlchemyObjectType ):
83
+ class Meta :
84
+ abstract = True
101
85
102
86
103
87
class CustomCharacter (CustomSQLAlchemyObjectType ):
@@ -106,6 +90,7 @@ class Meta:
106
90
model = Reporter
107
91
registry = registry
108
92
93
+
109
94
def test_custom_objecttype_registered ():
110
95
assert issubclass (CustomCharacter , ObjectType )
111
96
assert CustomCharacter ._meta .model == Reporter
0 commit comments