diff options
| author | Simon Charette <charette.s@gmail.com> | 2016-02-04 11:47:51 -0500 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2016-02-04 12:30:34 -0500 |
| commit | 6eb3ce11e4d6be237ad2e4895d8ae0b7bc1803dc (patch) | |
| tree | 0b14e1f387c7009cb89fcf905722805bc43392f2 /tests/auth_tests/test_management.py | |
| parent | 19318507d92d35f5f5cee6bfb7c379efa309c4f8 (diff) | |
Fixed #26089 -- Removed custom user test models from public API.
Thanks to Tim Graham for the review.
Diffstat (limited to 'tests/auth_tests/test_management.py')
| -rw-r--r-- | tests/auth_tests/test_management.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auth_tests/test_management.py b/tests/auth_tests/test_management.py index ab8e8a60e0..4183c96c8e 100644 --- a/tests/auth_tests/test_management.py +++ b/tests/auth_tests/test_management.py @@ -14,7 +14,6 @@ from django.contrib.auth.management.commands import ( from django.contrib.auth.models import ( AbstractBaseUser, Group, Permission, User, ) -from django.contrib.auth.tests.custom_user import CustomUser from django.contrib.contenttypes.models import ContentType from django.core import checks, exceptions from django.core.management import call_command @@ -28,7 +27,9 @@ from django.utils import six from django.utils.encoding import force_str from django.utils.translation import ugettext_lazy as _ -from .models import CustomUserNonUniqueUsername, CustomUserWithFK, Email +from .models import ( + CustomUser, CustomUserNonUniqueUsername, CustomUserWithFK, Email, +) def mock_inputs(inputs): @@ -287,7 +288,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase): self.assertEqual(u.email, 'joe@somewhere.org') self.assertFalse(u.has_usable_password()) - @override_settings(AUTH_USER_MODEL='auth.CustomUser') + @override_settings(AUTH_USER_MODEL='auth_tests.CustomUser') def test_swappable_user(self): "A superuser can be created when a custom User model is in use" # We can use the management command to create a superuser @@ -309,7 +310,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase): # created password should be unusable self.assertFalse(u.has_usable_password()) - @override_settings(AUTH_USER_MODEL='auth.CustomUser') + @override_settings(AUTH_USER_MODEL='auth_tests.CustomUser') def test_swappable_user_missing_required_field(self): "A Custom superuser won't be created when a required field isn't provided" # We can use the management command to create a superuser |
