1
1
import pytest
2
2
from django .db import models
3
3
from django .utils .translation import ugettext_lazy as _
4
+ from graphene import NonNull
4
5
from py .test import raises
5
6
6
7
import graphene
@@ -234,8 +235,12 @@ class Meta:
234
235
assert isinstance (graphene_field , graphene .Dynamic )
235
236
dynamic_field = graphene_field .get_type ()
236
237
assert isinstance (dynamic_field , graphene .Field )
237
- assert isinstance (dynamic_field .type , graphene .List )
238
- assert dynamic_field .type .of_type == A
238
+ # A NonNull List of NonNull A ([A!]!)
239
+ # https://github.com/graphql-python/graphene-django/issues/448
240
+ assert isinstance (dynamic_field .type , NonNull )
241
+ assert isinstance (dynamic_field .type .of_type , graphene .List )
242
+ assert isinstance (dynamic_field .type .of_type .of_type , NonNull )
243
+ assert dynamic_field .type .of_type .of_type .of_type == A
239
244
240
245
241
246
def test_should_manytomany_convert_connectionorlist_connection ():
@@ -262,8 +267,11 @@ class Meta:
262
267
assert isinstance (graphene_field , graphene .Dynamic )
263
268
dynamic_field = graphene_field .get_type ()
264
269
assert isinstance (dynamic_field , graphene .Field )
265
- assert isinstance (dynamic_field .type , graphene .List )
266
- assert dynamic_field .type .of_type == A
270
+ # a NonNull List of NonNull A ([A!]!)
271
+ assert isinstance (dynamic_field .type , NonNull )
272
+ assert isinstance (dynamic_field .type .of_type , graphene .List )
273
+ assert isinstance (dynamic_field .type .of_type .of_type , NonNull )
274
+ assert dynamic_field .type .of_type .of_type .of_type == A
267
275
268
276
269
277
def test_should_onetoone_reverse_convert_model ():
0 commit comments