Added FileField and ImageField conversion. Fixed #137

This commit is contained in:
Syrus Akbary 2016-04-02 16:24:32 -07:00
parent 1f548f188d
commit a1dd2b6293
2 changed files with 9 additions and 0 deletions

View File

@ -31,6 +31,7 @@ def convert_django_field(field):
@convert_django_field.register(models.SlugField)
@convert_django_field.register(models.URLField)
@convert_django_field.register(models.GenericIPAddressField)
@convert_django_field.register(models.FileField)
@convert_django_field.register(UUIDField)
def convert_field_to_string(field):
return String(description=field.help_text)

View File

@ -53,6 +53,14 @@ def test_should_ipaddress_convert_string():
assert_conversion(models.GenericIPAddressField, graphene.String)
def test_should_file_convert_string():
assert_conversion(models.FileField, graphene.String)
def test_should_image_convert_string():
assert_conversion(models.ImageField, graphene.String)
def test_should_auto_convert_id():
assert_conversion(models.AutoField, graphene.ID, primary_key=True)