mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-04-26 03:53:46 +03:00
Add test to converter
This commit is contained in:
parent
9e007b962e
commit
b3d418253b
|
@ -14,6 +14,7 @@ from graphene import (
|
||||||
DateTime,
|
DateTime,
|
||||||
Date,
|
Date,
|
||||||
Time,
|
Time,
|
||||||
|
Enum,
|
||||||
)
|
)
|
||||||
|
|
||||||
from ..converter import convert_form_field
|
from ..converter import convert_form_field
|
||||||
|
@ -112,3 +113,9 @@ def test_should_manytoone_convert_connectionorlist():
|
||||||
field = forms.ModelChoiceField(queryset=None)
|
field = forms.ModelChoiceField(queryset=None)
|
||||||
graphene_type = convert_form_field(field)
|
graphene_type = convert_form_field(field)
|
||||||
assert isinstance(graphene_type, ID)
|
assert isinstance(graphene_type, ID)
|
||||||
|
|
||||||
|
|
||||||
|
def test_should_typed_choice_convert_enum():
|
||||||
|
field = forms.TypedChoiceField(choices=(('A', 'Choice A'), ('B', 'Choice B')))
|
||||||
|
graphene_type = convert_form_field(field, 'field')
|
||||||
|
assert isinstance(graphene_type, Enum)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user