Skip to content

Commit 17e9bd3

Browse files
author
Jacob Foster
committed
Fix existing test with ast mock
1 parent 2d2c5ee commit 17e9bd3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

graphene_django/tests/test_types.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from mock import patch
1+
from mock import Mock, patch
22

33
from graphene import Interface, ObjectType, Schema
44
from graphene.relay import Node
@@ -38,7 +38,11 @@ def test_django_interface():
3838

3939
@patch('graphene_django.tests.models.Article.objects.get', return_value=Article(id=1))
4040
def test_django_get_node(get):
41-
article = Article.get_node(1, None, None)
41+
ast_mock = Mock()
42+
ast_mock.selection_set.selections = []
43+
info_mock = Mock(field_asts=[ast_mock])
44+
45+
article = Article.get_node(1, None, info_mock)
4246
get.assert_called_with(pk=1)
4347
assert article.id == 1
4448

0 commit comments

Comments
 (0)