From ef22d512b54cbf0b5f76151bc760391d839fbf72 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Mon, 14 Oct 2013 10:11:18 +0200 Subject: [PATCH] Imported custom user classes in tests depending on it Without those imports, affected test files cannot be run independently. Refs #21164. --- django/contrib/auth/tests/test_decorators.py | 2 ++ django/contrib/auth/tests/test_models.py | 1 + django/contrib/auth/tests/test_views.py | 1 + 3 files changed, 4 insertions(+) diff --git a/django/contrib/auth/tests/test_decorators.py b/django/contrib/auth/tests/test_decorators.py index 22ad9336449..35a2203ba9b 100644 --- a/django/contrib/auth/tests/test_decorators.py +++ b/django/contrib/auth/tests/test_decorators.py @@ -1,6 +1,8 @@ from django.conf import settings from django.contrib.auth import models from django.contrib.auth.decorators import login_required, permission_required +# Trigger CustomUser perm creation: +from django.contrib.auth.tests.custom_user import CustomUser from django.contrib.auth.tests.test_views import AuthViewsTestCase from django.contrib.auth.tests.utils import skipIfCustomUser from django.core.exceptions import PermissionDenied diff --git a/django/contrib/auth/tests/test_models.py b/django/contrib/auth/tests/test_models.py index 1373a3c1c16..8e2deb9562d 100644 --- a/django/contrib/auth/tests/test_models.py +++ b/django/contrib/auth/tests/test_models.py @@ -1,5 +1,6 @@ from django.contrib.auth import get_user_model from django.contrib.auth.models import AbstractUser, Group, User, UserManager +from django.contrib.auth.tests.custom_user import IsActiveTestUser1 from django.contrib.auth.tests.utils import skipIfCustomUser from django.core import mail from django.db.models.signals import post_save diff --git a/django/contrib/auth/tests/test_views.py b/django/contrib/auth/tests/test_views.py index 16c695c7fde..ce69048bfbf 100644 --- a/django/contrib/auth/tests/test_views.py +++ b/django/contrib/auth/tests/test_views.py @@ -21,6 +21,7 @@ from django.contrib.sessions.middleware import SessionMiddleware from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME from django.contrib.auth.forms import (AuthenticationForm, PasswordChangeForm, SetPasswordForm) +from django.contrib.auth.tests.custom_user import CustomUser from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.auth.views import login as login_view