diff --git a/graphene_django/tests/test_auth.py b/graphene_django/tests/test_auth.py index a875bf3..e2acb7c 100644 --- a/graphene_django/tests/test_auth.py +++ b/graphene_django/tests/test_auth.py @@ -1,7 +1,7 @@ import datetime +import sys import pytest -from unittest.mock import Mock from django.db import models from django.utils.functional import SimpleLazyObject from py.test import raises @@ -22,6 +22,11 @@ from ..rest_framework.mutation import SerializerMutation pytestmark = pytest.mark.django_db +if sys.version_info < (3, 0): + from unittest.mock import Mock +else: + from mock import Mock + class MockUserContext(object):