diff --git a/dbbackup/tests/commands/test_base.py b/dbbackup/tests/commands/test_base.py index 322564ba..1db8691a 100644 --- a/dbbackup/tests/commands/test_base.py +++ b/dbbackup/tests/commands/test_base.py @@ -5,10 +5,10 @@ import logging import os from io import BytesIO +from unittest.mock import patch from django.core.files import File from django.test import TestCase -from mock import patch from dbbackup.management.commands._base import BaseDbBackupCommand from dbbackup.storage import get_storage diff --git a/dbbackup/tests/commands/test_listbackups.py b/dbbackup/tests/commands/test_listbackups.py index f541e527..4ff25dc4 100644 --- a/dbbackup/tests/commands/test_listbackups.py +++ b/dbbackup/tests/commands/test_listbackups.py @@ -1,8 +1,8 @@ from io import StringIO +from unittest.mock import patch from django.core.management import execute_from_command_line from django.test import TestCase -from mock import patch from dbbackup.management.commands.listbackups import Command as ListbackupsCommand from dbbackup.storage import get_storage diff --git a/dbbackup/tests/functional/test_commands.py b/dbbackup/tests/functional/test_commands.py index 8434a5ca..b5e5a04e 100644 --- a/dbbackup/tests/functional/test_commands.py +++ b/dbbackup/tests/functional/test_commands.py @@ -1,10 +1,10 @@ import os import tempfile +from unittest.mock import patch from django.conf import settings from django.core.management import execute_from_command_line from django.test import TransactionTestCase as TestCase -from mock import patch from dbbackup.tests.testapp import models from dbbackup.tests.utils import ( diff --git a/dbbackup/tests/test_checks.py b/dbbackup/tests/test_checks.py index 642882b6..2a58332a 100644 --- a/dbbackup/tests/test_checks.py +++ b/dbbackup/tests/test_checks.py @@ -1,5 +1,6 @@ +from unittest.mock import patch + from django.test import TestCase -from mock import patch try: from dbbackup import checks diff --git a/dbbackup/tests/test_connectors/test_mongodb.py b/dbbackup/tests/test_connectors/test_mongodb.py index c0330276..7a632cde 100644 --- a/dbbackup/tests/test_connectors/test_mongodb.py +++ b/dbbackup/tests/test_connectors/test_mongodb.py @@ -1,7 +1,7 @@ from io import BytesIO +from unittest.mock import patch from django.test import TestCase -from mock import patch from dbbackup.db.mongodb import MongoDumpConnector diff --git a/dbbackup/tests/test_connectors/test_mysql.py b/dbbackup/tests/test_connectors/test_mysql.py index 35d4aa97..95625ae6 100644 --- a/dbbackup/tests/test_connectors/test_mysql.py +++ b/dbbackup/tests/test_connectors/test_mysql.py @@ -1,7 +1,7 @@ from io import BytesIO +from unittest.mock import patch from django.test import TestCase -from mock import patch from dbbackup.db.mysql import MysqlDumpConnector diff --git a/dbbackup/tests/test_connectors/test_sqlite.py b/dbbackup/tests/test_connectors/test_sqlite.py index 359abcdf..b448fb34 100644 --- a/dbbackup/tests/test_connectors/test_sqlite.py +++ b/dbbackup/tests/test_connectors/test_sqlite.py @@ -1,8 +1,8 @@ from io import BytesIO +from unittest.mock import mock_open, patch from django.db import connection from django.test import TestCase -from mock import mock_open, patch from dbbackup.db.sqlite import SqliteConnector, SqliteCPConnector from dbbackup.tests.testapp.models import CharModel diff --git a/dbbackup/tests/test_log.py b/dbbackup/tests/test_log.py index d394a511..5419c250 100644 --- a/dbbackup/tests/test_log.py +++ b/dbbackup/tests/test_log.py @@ -1,9 +1,9 @@ import logging +from unittest.mock import patch import django from django.core import mail from django.test import TestCase -from mock import patch from testfixtures import log_capture from dbbackup import log diff --git a/dbbackup/tests/test_storage.py b/dbbackup/tests/test_storage.py index e5ba32fb..2153f676 100644 --- a/dbbackup/tests/test_storage.py +++ b/dbbackup/tests/test_storage.py @@ -1,5 +1,6 @@ +from unittest.mock import patch + from django.test import TestCase -from mock import patch from dbbackup import utils from dbbackup.storage import Storage, get_storage diff --git a/dbbackup/tests/test_utils.py b/dbbackup/tests/test_utils.py index 764e7cad..51862259 100644 --- a/dbbackup/tests/test_utils.py +++ b/dbbackup/tests/test_utils.py @@ -2,12 +2,12 @@ import tempfile from datetime import datetime from io import StringIO +from unittest.mock import patch import django import pytz from django.core import mail from django.test import TestCase -from mock import patch from dbbackup import settings, utils from dbbackup.tests.utils import ( diff --git a/requirements/tests.txt b/requirements/tests.txt index a189f4c9..723a0d83 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -1,7 +1,6 @@ coverage django-storages flake8 -mock pep8 psycopg2 pylint