mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-22 22:52:58 +03:00
Add test for choices with duplicate display values
This commit is contained in:
parent
8bc14953d7
commit
a8777c0dfb
|
@ -117,6 +117,21 @@ def test_field_with_choices_convert_enum():
|
||||||
assert graphene_type.__enum__.__members__['ENGLISH'].value == 'en'
|
assert graphene_type.__enum__.__members__['ENGLISH'].value == 'en'
|
||||||
|
|
||||||
|
|
||||||
|
def test_field_with_choices_duplicate_display_value():
|
||||||
|
field = models.CharField(help_text='Language', choices=(
|
||||||
|
('es', 'Spanish'),
|
||||||
|
('en', 'Spanish')
|
||||||
|
))
|
||||||
|
|
||||||
|
class TranslatedModel(models.Model):
|
||||||
|
language = field
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
app_label = 'test'
|
||||||
|
|
||||||
|
convert_django_field_with_choices(field)
|
||||||
|
|
||||||
|
|
||||||
def test_should_float_convert_float():
|
def test_should_float_convert_float():
|
||||||
assert_conversion(models.FloatField, graphene.Float)
|
assert_conversion(models.FloatField, graphene.Float)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user