11import pytest
22from django .db import models
33from django .utils .translation import ugettext_lazy as _
4+ from graphene import NonNull
45from py .test import raises
56
67import graphene
@@ -234,8 +235,12 @@ class Meta:
234235 assert isinstance (graphene_field , graphene .Dynamic )
235236 dynamic_field = graphene_field .get_type ()
236237 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
239244
240245
241246def test_should_manytomany_convert_connectionorlist_connection ():
@@ -262,8 +267,11 @@ class Meta:
262267 assert isinstance (graphene_field , graphene .Dynamic )
263268 dynamic_field = graphene_field .get_type ()
264269 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
267275
268276
269277def test_should_onetoone_reverse_convert_model ():
0 commit comments