|
20 | 20 |
|
21 | 21 |
|
22 | 22 | def assert_conversion(django_field, graphene_field, *args, **kwargs):
|
23 |
| - field = django_field(help_text='Custom Help Text', *args, **kwargs) |
| 23 | + field = django_field(help_text='Custom Help Text', null=True, *args, **kwargs) |
24 | 24 | graphene_type = convert_django_field(field)
|
25 | 25 | assert isinstance(graphene_type, graphene_field)
|
26 | 26 | field = graphene_type.Field()
|
27 | 27 | assert field.description == 'Custom Help Text'
|
| 28 | + nonnull_field = django_field(null=False, *args, **kwargs) |
| 29 | + if not nonnull_field.null: |
| 30 | + nonnull_graphene_type = convert_django_field(nonnull_field) |
| 31 | + nonnull_field = nonnull_graphene_type.Field() |
| 32 | + assert isinstance(nonnull_field.type, graphene.NonNull) |
| 33 | + return nonnull_field |
28 | 34 | return field
|
29 | 35 |
|
30 | 36 |
|
@@ -226,8 +232,7 @@ class Meta:
|
226 | 232 | assert isinstance(graphene_field, graphene.Dynamic)
|
227 | 233 | dynamic_field = graphene_field.get_type()
|
228 | 234 | assert isinstance(dynamic_field, graphene.Field)
|
229 |
| - assert isinstance(dynamic_field.type, graphene.NonNull) |
230 |
| - assert dynamic_field.of_type.type == A |
| 235 | + assert dynamic_field.type == A |
231 | 236 |
|
232 | 237 |
|
233 | 238 | @pytest.mark.skipif(ArrayField is MissingType,
|
|
0 commit comments