Add test for django grouped choices

This commit is contained in:
Ian Foote 2016-05-26 16:07:18 +01:00
parent 8bc14953d7
commit 7d5d7eac3c

View File

@ -117,6 +117,23 @@ def test_field_with_choices_convert_enum():
assert graphene_type.__enum__.__members__['ENGLISH'].value == 'en'
def test_field_with_grouped_choices():
field = models.CharField(help_text='Language', choices=(
('Europe', (
('es', 'Spanish'),
('en', 'English'),
)),
))
class TranslatedModel(models.Model):
language = field
class Meta:
app_label = 'test'
convert_django_field_with_choices(field)
def test_should_float_convert_float():
assert_conversion(models.FloatField, graphene.Float)