mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-22 17:47:12 +03:00
Added support for FilePathField
This commit is contained in:
parent
4e7b269b76
commit
27a7c0e299
|
@ -80,6 +80,7 @@ def convert_django_field(field, registry=None):
|
|||
@convert_django_field.register(models.URLField)
|
||||
@convert_django_field.register(models.GenericIPAddressField)
|
||||
@convert_django_field.register(models.FileField)
|
||||
@convert_django_field.register(models.FilePathField)
|
||||
def convert_field_to_string(field, registry=None):
|
||||
return String(description=field.help_text, required=not field.null)
|
||||
|
||||
|
|
|
@ -82,6 +82,10 @@ def test_should_image_convert_string():
|
|||
assert_conversion(models.ImageField, graphene.String)
|
||||
|
||||
|
||||
def test_should_url_convert_string():
|
||||
assert_conversion(models.FilePathField, graphene.String)
|
||||
|
||||
|
||||
def test_should_auto_convert_id():
|
||||
assert_conversion(models.AutoField, graphene.ID, primary_key=True)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user