mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-29 04:53:43 +03:00
Fixed Python3 tests
This commit is contained in:
parent
ec4b164de3
commit
7756b0df8f
|
@ -27,16 +27,20 @@ def test_should_map_fields_correctly():
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Reporter
|
model = Reporter
|
||||||
registry = Registry()
|
registry = Registry()
|
||||||
assert list(
|
fields = list(ReporterType2._meta.fields.keys())
|
||||||
ReporterType2._meta.fields.keys()) == [
|
assert fields[:-2] == [
|
||||||
'id',
|
'id',
|
||||||
'first_name',
|
'first_name',
|
||||||
'last_name',
|
'last_name',
|
||||||
'email',
|
'email',
|
||||||
'pets',
|
'pets',
|
||||||
'a_choice',
|
'a_choice',
|
||||||
|
]
|
||||||
|
|
||||||
|
assert sorted(fields[-2:]) == [
|
||||||
'articles',
|
'articles',
|
||||||
'films']
|
'films',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def test_should_map_only_few_fields():
|
def test_should_map_only_few_fields():
|
||||||
|
|
|
@ -45,7 +45,9 @@ def test_django_get_node(get):
|
||||||
|
|
||||||
def test_django_objecttype_map_correct_fields():
|
def test_django_objecttype_map_correct_fields():
|
||||||
fields = Reporter._meta.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():
|
def test_django_objecttype_with_node_have_correct_fields():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user