Fixed #26089 -- Removed custom user test models from public API.

Thanks to Tim Graham for the review.
This commit is contained in:
Simon Charette 2016-02-04 11:47:51 -05:00
parent 19318507d9
commit 6eb3ce11e4
12 changed files with 47 additions and 38 deletions

View file

@ -8,7 +8,6 @@ from django.contrib.auth import (
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.hashers import MD5PasswordHasher
from django.contrib.auth.models import AnonymousUser, Group, Permission, User
from django.contrib.auth.tests.custom_user import CustomUser, ExtensionUser
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.http import HttpRequest
@ -16,7 +15,7 @@ from django.test import (
SimpleTestCase, TestCase, modify_settings, override_settings,
)
from .models import CustomPermissionsUser, UUIDUser
from .models import CustomPermissionsUser, CustomUser, ExtensionUser, UUIDUser
class CountingMD5PasswordHasher(MD5PasswordHasher):
@ -215,7 +214,7 @@ class ModelBackendTest(BaseModelBackendTest, TestCase):
)
@override_settings(AUTH_USER_MODEL='auth.ExtensionUser')
@override_settings(AUTH_USER_MODEL='auth_tests.ExtensionUser')
class ExtensionUserModelBackendTest(BaseModelBackendTest, TestCase):
"""
Tests for the ModelBackend using the custom ExtensionUser model.
@ -275,7 +274,7 @@ class CustomPermissionsUserModelBackendTest(BaseModelBackendTest, TestCase):
)
@override_settings(AUTH_USER_MODEL='auth.CustomUser')
@override_settings(AUTH_USER_MODEL='auth_tests.CustomUser')
class CustomUserModelBackendAuthenticateTest(TestCase):
"""
Tests that the model backend can accept a credentials kwarg labeled with