mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-05 21:03:13 +03:00
Fix test collection
This commit is contained in:
parent
1a4e30af39
commit
51fe6d06a9
|
@ -23,7 +23,7 @@ from graphene import (
|
||||||
)
|
)
|
||||||
from graphene.types.json import JSONString
|
from graphene.types.json import JSONString
|
||||||
from graphene.utils.str_converters import to_camel_case, to_const
|
from graphene.utils.str_converters import to_camel_case, to_const
|
||||||
from graphql import assert_valid_name
|
from graphql import assert_valid_name, GraphQLError
|
||||||
|
|
||||||
from .settings import graphene_settings
|
from .settings import graphene_settings
|
||||||
from .compat import ArrayField, HStoreField, JSONField, RangeField
|
from .compat import ArrayField, HStoreField, JSONField, RangeField
|
||||||
|
@ -34,7 +34,7 @@ def convert_choice_name(name):
|
||||||
name = to_const(force_str(name))
|
name = to_const(force_str(name))
|
||||||
try:
|
try:
|
||||||
assert_valid_name(name)
|
assert_valid_name(name)
|
||||||
except AssertionError:
|
except GraphQLError:
|
||||||
name = "A_%s" % name
|
name = "A_%s" % name
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ def get_choices(choices):
|
||||||
while name in converted_names:
|
while name in converted_names:
|
||||||
name += "_" + str(len(converted_names))
|
name += "_" + str(len(converted_names))
|
||||||
converted_names.append(name)
|
converted_names.append(name)
|
||||||
description = help_text
|
description = str(help_text) # TODO: translatable description: https://github.com/graphql-python/graphql-core-next/issues/58
|
||||||
yield name, value, description
|
yield name, value, description
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user