Fixed tests

This commit is contained in:
Syrus Akbary 2016-10-15 16:04:32 -07:00
parent 3a9ffba560
commit 459270cc09
2 changed files with 11 additions and 11 deletions

View File

@ -124,10 +124,10 @@ def test_field_with_choices_convert_enum():
graphene_type = convert_django_field_with_choices(field) graphene_type = convert_django_field_with_choices(field)
assert isinstance(graphene_type, graphene.Enum) assert isinstance(graphene_type, graphene.Enum)
assert graphene_type._meta.name == 'TranslatedModelLanguage' assert graphene_type._meta.name == 'TranslatedModelLanguage'
assert graphene_type._meta.enum.__members__['SPANISH'].value == 'es' assert graphene_type._meta.enum.__members__['ES'].value == 'es'
assert graphene_type._meta.enum.__members__['SPANISH'].description == 'Spanish' assert graphene_type._meta.enum.__members__['ES'].description == 'Spanish'
assert graphene_type._meta.enum.__members__['ENGLISH'].value == 'en' assert graphene_type._meta.enum.__members__['EN'].value == 'en'
assert graphene_type._meta.enum.__members__['ENGLISH'].description == 'English' assert graphene_type._meta.enum.__members__['EN'].description == 'English'
def test_field_with_grouped_choices(): def test_field_with_grouped_choices():

View File

@ -39,7 +39,7 @@ def test_django_interface():
@patch('graphene_django.tests.models.Article.objects.get', return_value=Article(id=1)) @patch('graphene_django.tests.models.Article.objects.get', return_value=Article(id=1))
def test_django_get_node(get): def test_django_get_node(get):
article = Article.get_node(1, None, None) article = Article.get_node(1, None, None)
get.assert_called_with(id=1) get.assert_called_with(pk=1)
assert article.id == 1 assert article.id == 1
@ -81,13 +81,13 @@ type ArticleEdge {
} }
enum ArticleImportance { enum ArticleImportance {
VERY_IMPORTANT A_1
NOT_AS_IMPORTANT A_2
} }
enum ArticleLang { enum ArticleLang {
SPANISH ES
ENGLISH EN
} }
scalar DateTime scalar DateTime
@ -114,8 +114,8 @@ type Reporter {
} }
enum ReporterA_choice { enum ReporterA_choice {
THIS A_1
THAT A_2
} }
type RootQuery { type RootQuery {