From 7756b0df8f7ae7a2a29438c4f1a1fefc76725fb8 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Sat, 17 Sep 2016 17:28:41 -0700 Subject: [PATCH] Fixed Python3 tests --- graphene_django/tests/test_schema.py | 10 +++++++--- graphene_django/tests/test_types.py | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/graphene_django/tests/test_schema.py b/graphene_django/tests/test_schema.py index a3a2307..32db172 100644 --- a/graphene_django/tests/test_schema.py +++ b/graphene_django/tests/test_schema.py @@ -27,16 +27,20 @@ def test_should_map_fields_correctly(): class Meta: model = Reporter registry = Registry() - assert list( - ReporterType2._meta.fields.keys()) == [ + fields = list(ReporterType2._meta.fields.keys()) + assert fields[:-2] == [ 'id', 'first_name', 'last_name', 'email', 'pets', 'a_choice', + ] + + assert sorted(fields[-2:]) == [ 'articles', - 'films'] + 'films', + ] def test_should_map_only_few_fields(): diff --git a/graphene_django/tests/test_types.py b/graphene_django/tests/test_types.py index ed9f1df..22f49c9 100644 --- a/graphene_django/tests/test_types.py +++ b/graphene_django/tests/test_types.py @@ -45,7 +45,9 @@ def test_django_get_node(get): def test_django_objecttype_map_correct_fields(): fields = Reporter._meta.fields - assert list(fields.keys()) == ['id', 'first_name', 'last_name', 'email', 'pets', 'a_choice', 'articles', 'films'] + fields = list(fields.keys()) + assert fields[:-2] == ['id', 'first_name', 'last_name', 'email', 'pets', 'a_choice'] + assert sorted(fields[-2:]) == ['articles', 'films'] def test_django_objecttype_with_node_have_correct_fields():