File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
graphene_sqlalchemy/tests Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -153,3 +153,28 @@ def test_objecttype_with_custom_options():
153153 'articles' ,
154154 'favorite_article' ]
155155 assert ReporterWithCustomOptions ._meta .custom_option == 'custom_option'
156+
157+
158+ class ReporterWithCustomOptionsAndField (SQLAlchemyObjectTypeWithCustomOptions ):
159+ class Meta :
160+ model = Reporter
161+ custom_option = 'custom_option'
162+
163+ custom_field = Field (Int ())
164+
165+
166+ def test_objecttype_with_custom_options_and_field ():
167+ assert issubclass (ReporterWithCustomOptions , ObjectType )
168+ assert ReporterWithCustomOptions ._meta .model == Reporter
169+ assert list (
170+ ReporterWithCustomOptionsAndField ._meta .fields .keys ()) == [
171+ 'id' ,
172+ 'first_name' ,
173+ 'last_name' ,
174+ 'email' ,
175+ 'pets' ,
176+ 'articles' ,
177+ 'favorite_article' ,
178+ 'custom_field' ]
179+ assert ReporterWithCustomOptionsAndField ._meta .custom_option == 'custom_option'
180+ assert isinstance (ReporterWithCustomOptionsAndField ._meta .fields ['custom_field' ].type , Int )
You can’t perform that action at this time.
0 commit comments