Skip to content

Commit 7756b0d

Browse files
committed
Fixed Python3 tests
1 parent ec4b164 commit 7756b0d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

graphene_django/tests/test_schema.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,20 @@ class ReporterType2(DjangoObjectType):
2727
class Meta:
2828
model = Reporter
2929
registry = Registry()
30-
assert list(
31-
ReporterType2._meta.fields.keys()) == [
30+
fields = list(ReporterType2._meta.fields.keys())
31+
assert fields[:-2] == [
3232
'id',
3333
'first_name',
3434
'last_name',
3535
'email',
3636
'pets',
3737
'a_choice',
38+
]
39+
40+
assert sorted(fields[-2:]) == [
3841
'articles',
39-
'films']
42+
'films',
43+
]
4044

4145

4246
def test_should_map_only_few_fields():

graphene_django/tests/test_types.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ def test_django_get_node(get):
4545

4646
def test_django_objecttype_map_correct_fields():
4747
fields = Reporter._meta.fields
48-
assert list(fields.keys()) == ['id', 'first_name', 'last_name', 'email', 'pets', 'a_choice', 'articles', 'films']
48+
fields = list(fields.keys())
49+
assert fields[:-2] == ['id', 'first_name', 'last_name', 'email', 'pets', 'a_choice']
50+
assert sorted(fields[-2:]) == ['articles', 'films']
4951

5052

5153
def test_django_objecttype_with_node_have_correct_fields():

0 commit comments

Comments
 (0)