Skip to content

Commit 472761b

Browse files
committed
tests: Use unittest.mock if available
1 parent 29409d4 commit 472761b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tests/test_oauth2_backends.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import json
22

3-
import mock
3+
try:
4+
from unittest import mock
5+
except ImportError:
6+
import mock
47

58
from django.test import RequestFactory, TestCase
69

tests/test_oauth2_validators.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import datetime
22

3-
import mock
3+
try:
4+
from unittest import mock
5+
except ImportError:
6+
import mock
47

58
from django.contrib.auth import get_user_model
69
from django.test import TransactionTestCase

0 commit comments

Comments
 (0)