mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #26089 -- Removed custom user test models from public API.
Thanks to Tim Graham for the review.
This commit is contained in:
parent
19318507d9
commit
6eb3ce11e4
12 changed files with 47 additions and 38 deletions
|
@ -4,9 +4,10 @@ from django.contrib.auth.handlers.modwsgi import (
|
|||
check_password, groups_for_user,
|
||||
)
|
||||
from django.contrib.auth.models import Group, User
|
||||
from django.contrib.auth.tests.custom_user import CustomUser
|
||||
from django.test import TransactionTestCase, override_settings
|
||||
|
||||
from .models import CustomUser
|
||||
|
||||
|
||||
# This must be a TransactionTestCase because the WSGI auth handler performs
|
||||
# its own transaction management.
|
||||
|
@ -18,6 +19,7 @@ class ModWsgiHandlerTestCase(TransactionTestCase):
|
|||
available_apps = [
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'auth_tests',
|
||||
]
|
||||
|
||||
def test_check_password(self):
|
||||
|
@ -40,7 +42,7 @@ class ModWsgiHandlerTestCase(TransactionTestCase):
|
|||
# Valid user with incorrect password
|
||||
self.assertFalse(check_password({}, 'test', 'incorrect'))
|
||||
|
||||
@override_settings(AUTH_USER_MODEL='auth.CustomUser')
|
||||
@override_settings(AUTH_USER_MODEL='auth_tests.CustomUser')
|
||||
def test_check_password_custom_user(self):
|
||||
"""
|
||||
Verify that check_password returns the correct values as per
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue