diff options
| author | Tim Graham <timograham@gmail.com> | 2017-01-19 12:16:04 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-01-20 08:17:20 -0500 |
| commit | 7aba69145dcb436539a7798086748b73a39121e5 (patch) | |
| tree | 8f1f4edeec13f02916366e8c961c3028ec0b6560 /tests/auth_tests | |
| parent | 042b7350a080cc964f913faf1cf7f0097f650a58 (diff) | |
Refs #23919 -- Removed django.test.mock Python 2 compatibility shim.
Diffstat (limited to 'tests/auth_tests')
| -rw-r--r-- | tests/auth_tests/test_admin_multidb.py | 4 | ||||
| -rw-r--r-- | tests/auth_tests/test_auth_backends.py | 3 | ||||
| -rw-r--r-- | tests/auth_tests/test_forms.py | 3 | ||||
| -rw-r--r-- | tests/auth_tests/test_hashers.py | 4 | ||||
| -rw-r--r-- | tests/auth_tests/test_management.py | 3 | ||||
| -rw-r--r-- | tests/auth_tests/test_mixins.py | 4 | ||||
| -rw-r--r-- | tests/auth_tests/test_models.py | 4 |
7 files changed, 17 insertions, 8 deletions
diff --git a/tests/auth_tests/test_admin_multidb.py b/tests/auth_tests/test_admin_multidb.py index 122cb78876..6b36b50a16 100644 --- a/tests/auth_tests/test_admin_multidb.py +++ b/tests/auth_tests/test_admin_multidb.py @@ -1,9 +1,11 @@ +from unittest import mock + from django.conf.urls import url from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.db import connections -from django.test import TestCase, mock, override_settings +from django.test import TestCase, override_settings from django.urls import reverse diff --git a/tests/auth_tests/test_auth_backends.py b/tests/auth_tests/test_auth_backends.py index 033df9c682..3d929698c9 100644 --- a/tests/auth_tests/test_auth_backends.py +++ b/tests/auth_tests/test_auth_backends.py @@ -1,4 +1,5 @@ from datetime import date +from unittest import mock from django.contrib.auth import ( BACKEND_SESSION_KEY, SESSION_KEY, authenticate, get_user, signals, @@ -10,7 +11,7 @@ from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.http import HttpRequest from django.test import ( - SimpleTestCase, TestCase, mock, modify_settings, override_settings, + SimpleTestCase, TestCase, modify_settings, override_settings, ) from .models import ( diff --git a/tests/auth_tests/test_forms.py b/tests/auth_tests/test_forms.py index ae6fa313de..bbcd75124a 100644 --- a/tests/auth_tests/test_forms.py +++ b/tests/auth_tests/test_forms.py @@ -1,5 +1,6 @@ import datetime import re +from unittest import mock from django import forms from django.contrib.auth.forms import ( @@ -13,7 +14,7 @@ from django.contrib.sites.models import Site from django.core import mail from django.core.mail import EmailMultiAlternatives from django.forms.fields import CharField, Field, IntegerField -from django.test import SimpleTestCase, TestCase, mock, override_settings +from django.test import SimpleTestCase, TestCase, override_settings from django.utils import translation from django.utils.encoding import force_text from django.utils.text import capfirst diff --git a/tests/auth_tests/test_hashers.py b/tests/auth_tests/test_hashers.py index 57982017eb..4e7bae280d 100644 --- a/tests/auth_tests/test_hashers.py +++ b/tests/auth_tests/test_hashers.py @@ -1,4 +1,4 @@ -from unittest import skipUnless +from unittest import mock, skipUnless from django.conf.global_settings import PASSWORD_HASHERS from django.contrib.auth.hashers import ( @@ -7,7 +7,7 @@ from django.contrib.auth.hashers import ( check_password, get_hasher, identify_hasher, is_password_usable, make_password, ) -from django.test import SimpleTestCase, mock +from django.test import SimpleTestCase from django.test.utils import override_settings from django.utils.encoding import force_bytes diff --git a/tests/auth_tests/test_management.py b/tests/auth_tests/test_management.py index 15ff551211..b1b629021f 100644 --- a/tests/auth_tests/test_management.py +++ b/tests/auth_tests/test_management.py @@ -2,6 +2,7 @@ import builtins import sys from datetime import date from io import StringIO +from unittest import mock from django.apps import apps from django.contrib.auth import management @@ -14,7 +15,7 @@ from django.contrib.contenttypes.models import ContentType from django.core.management import call_command from django.core.management.base import CommandError from django.db import migrations -from django.test import TestCase, mock, override_settings +from django.test import TestCase, override_settings from django.utils.translation import ugettext_lazy as _ from .models import ( diff --git a/tests/auth_tests/test_mixins.py b/tests/auth_tests/test_mixins.py index 4f74890304..0a0c5ccdf4 100644 --- a/tests/auth_tests/test_mixins.py +++ b/tests/auth_tests/test_mixins.py @@ -1,3 +1,5 @@ +from unittest import mock + from django.contrib.auth import models from django.contrib.auth.mixins import ( LoginRequiredMixin, PermissionRequiredMixin, UserPassesTestMixin, @@ -5,7 +7,7 @@ from django.contrib.auth.mixins import ( from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied from django.http import HttpResponse -from django.test import RequestFactory, TestCase, mock +from django.test import RequestFactory, TestCase from django.views.generic import View diff --git a/tests/auth_tests/test_models.py b/tests/auth_tests/test_models.py index ebe3dc0837..f688c5ae74 100644 --- a/tests/auth_tests/test_models.py +++ b/tests/auth_tests/test_models.py @@ -1,3 +1,5 @@ +from unittest import mock + from django.conf.global_settings import PASSWORD_HASHERS from django.contrib.auth import get_user_model from django.contrib.auth.base_user import AbstractBaseUser @@ -8,7 +10,7 @@ from django.contrib.auth.models import ( from django.contrib.contenttypes.models import ContentType from django.core import mail from django.db.models.signals import post_save -from django.test import TestCase, mock, override_settings +from django.test import TestCase, override_settings from .models.with_custom_email_field import CustomEmailField |
