mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-13 17:52:19 +03:00
Fix existing test with ast mock
This commit is contained in:
parent
2d2c5ee889
commit
17e9bd3331
|
@ -1,4 +1,4 @@
|
|||
from mock import patch
|
||||
from mock import Mock, patch
|
||||
|
||||
from graphene import Interface, ObjectType, Schema
|
||||
from graphene.relay import Node
|
||||
|
@ -38,7 +38,11 @@ def test_django_interface():
|
|||
|
||||
@patch('graphene_django.tests.models.Article.objects.get', return_value=Article(id=1))
|
||||
def test_django_get_node(get):
|
||||
article = Article.get_node(1, None, None)
|
||||
ast_mock = Mock()
|
||||
ast_mock.selection_set.selections = []
|
||||
info_mock = Mock(field_asts=[ast_mock])
|
||||
|
||||
article = Article.get_node(1, None, info_mock)
|
||||
get.assert_called_with(pk=1)
|
||||
assert article.id == 1
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user