Skip to content

Commit

Permalink
prefer new unittest.mock everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste authored and auvipy committed Sep 4, 2024
1 parent 1ad5586 commit b5cb93e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion tests_app/tests/unit/cache/decorators/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from django.core.cache import caches
from django.test import TestCase
from mock import Mock, patch
try:
from unittest.mock import Mock, patch
except ImportError:
from mock import Mock, patch
from rest_framework import views
from rest_framework.response import Response

Expand Down
6 changes: 4 additions & 2 deletions tests_app/tests/unit/key_constructor/bits/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from mock import Mock
from mock import PropertyMock
try:
from unittest.mock import Mock, PropertyMock
except ImportError:
from mock import Mock, PropertyMock

import django
from django.test import TestCase
Expand Down
5 changes: 4 additions & 1 deletion tests_app/tests/unit/key_constructor/constructor/tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from copy import deepcopy
import hashlib
import json
from mock import Mock, patch
try:
from unittest.mock import Mock, patch
except ImportError:
from mock import Mock, patch

from django.test import TestCase

Expand Down
5 changes: 4 additions & 1 deletion tests_app/testutils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import base64
from mock import patch
try:
from unittest.mock import patch
except ImportError:
from mock import patch

from rest_framework import HTTP_HEADER_ENCODING

Expand Down

0 comments on commit b5cb93e

Please sign in to comment.